Package org.hl7.fhir.dstu2.model
Class StringType
- java.lang.Object
-
- org.hl7.fhir.dstu2.model.Base
-
- org.hl7.fhir.dstu2.model.Element
-
- org.hl7.fhir.dstu2.model.Type
-
- org.hl7.fhir.dstu2.model.PrimitiveType<String>
-
- org.hl7.fhir.dstu2.model.StringType
-
- All Implemented Interfaces:
ca.uhn.fhir.model.api.IElement,Serializable,org.hl7.fhir.instance.model.api.IBase,org.hl7.fhir.instance.model.api.IBaseDatatype,org.hl7.fhir.instance.model.api.IBaseElement,org.hl7.fhir.instance.model.api.IBaseHasExtensions,org.hl7.fhir.instance.model.api.IPrimitiveType<String>
- Direct Known Subclasses:
CodeType,MarkdownType
public class StringType extends PrimitiveType<String>
Primitive type "string" in FHIR - any sequence of unicode characters less than 1MB in length- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description StringType()Create a new StringStringType(String theValue)Create a new String
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringTypecopy()protected Stringencode(String theValue)Subclasses must override to convert a "coerced" value into an encoded one.StringfhirType()StringgetValueNotNull()Returns the value of this StringType, or an empty string ("") if the value isnull.protected Stringparse(String theValue)Subclasses must override to convert an encoded representation of this datatype into a "coerced" oneStringtoString()Returns the value of this string, ornullif no value is present-
Methods inherited from class org.hl7.fhir.dstu2.model.PrimitiveType
asStringValue, equalsDeep, equalsShallow, fromStringValue, getValue, getValueAsString, hashCode, hasValue, isEmpty, isPrimitive, primitiveValue, setValue, setValueAsString, typedCopy, updateStringValue
-
Methods inherited from class org.hl7.fhir.dstu2.model.Element
addChild, addExtension, addExtension, copyValues, getExtension, getExtensionsByUrl, getExtensionString, getId, getIdElement, hasExtension, hasExtension, hasId, hasIdElement, listChildren, setId, setIdElement, setProperty
-
Methods inherited from class org.hl7.fhir.dstu2.model.Base
castToAddress, castToAnnotation, castToAttachment, castToBase64Binary, castToBoolean, castToCode, castToCodeableConcept, castToCoding, castToContactPoint, castToDate, castToDateTime, castToDecimal, castToDuration, castToElementDefinition, castToExtension, castToHumanName, castToId, castToIdentifier, castToInstant, castToInteger, castToMarkdown, castToMeta, castToMoney, castToNarrative, castToOid, castToPeriod, castToPositiveInt, castToQuantity, castToRange, castToRatio, castToReference, castToResource, castToSampledData, castToSignature, castToSimpleQuantity, castToString, castToTime, castToTiming, castToUnsignedInt, castToUri, children, compareDeep, compareDeep, compareDeep, compareValues, compareValues, equals, getChildByName, getFormatCommentsPost, getFormatCommentsPre, getUserData, getUserInt, getUserString, hasFormatComment, hasType, hasUserData, isMetadataBased, listChildrenByName, setUserData, setUserDataINN
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.hl7.fhir.instance.model.api.IBase
getFormatCommentsPost, getFormatCommentsPre, getUserData, hasFormatComment, setUserData
-
-
-
-
Constructor Detail
-
StringType
public StringType()
Create a new String
-
StringType
public StringType(String theValue)
Create a new String
-
-
Method Detail
-
getValueNotNull
public String getValueNotNull()
Returns the value of this StringType, or an empty string ("") if the value isnull. This method is provided as a convenience to users of this API.
-
toString
public String toString()
Returns the value of this string, ornullif no value is present- Overrides:
toStringin classPrimitiveType<String>
-
parse
protected String parse(String theValue)
Description copied from class:PrimitiveTypeSubclasses must override to convert an encoded representation of this datatype into a "coerced" one- Specified by:
parsein classPrimitiveType<String>- Parameters:
theValue- Will not be null- Returns:
- May return null if the value does not correspond to anything
-
encode
protected String encode(String theValue)
Description copied from class:PrimitiveTypeSubclasses must override to convert a "coerced" value into an encoded one.- Specified by:
encodein classPrimitiveType<String>- Parameters:
theValue- Will not be null- Returns:
- May return null if the value does not correspond to anything
-
copy
public StringType copy()
- Specified by:
copyin classPrimitiveType<String>
-
-