Package com.ibm.fhir.path
Class FHIRPathStringValue
- java.lang.Object
-
- com.ibm.fhir.path.FHIRPathAbstractNode
-
- com.ibm.fhir.path.FHIRPathStringValue
-
- All Implemented Interfaces:
FHIRPathNode,FHIRPathSystemValue,Comparable<FHIRPathNode>
public class FHIRPathStringValue extends FHIRPathAbstractNode implements FHIRPathSystemValue
AFHIRPathSystemValuenode that wraps aStringvalue
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFHIRPathStringValue.Builder
-
Field Summary
Fields Modifier and Type Field Description static FHIRPathStringValueEMPTY_STRING
-
Constructor Summary
Constructors Modifier Constructor Description protectedFHIRPathStringValue(FHIRPathStringValue.Builder builder)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(FHIRPathNodeVisitor visitor)A method for accepting aFHIRPathNodeVisitorstatic FHIRPathStringValue.Builderbuilder(String string)Static factory method for creating builder instances from aStringvalueintcompareTo(FHIRPathNode other)Compare theStringvalue wrapped by this FHIRPathStringValue node to the parameterFHIRPathStringValueconcat(FHIRPathStringValue value)booleancontains(FHIRPathStringValue substring)Indicates whether this FHIRPathStringValue contains the substring in the parameterbooleanendsWith(FHIRPathStringValue suffix)Indicates whether this FHIRPathStringValue ends with the suffix in the parameterbooleanequals(Object obj)Indicates whether theStringvalue wrapped by this FHIRPathStringValue node is equal the parameter (or its primitive value)inthashCode()booleanisComparableTo(FHIRPathNode other)Indicates whether this FHIRPathStringValue is comparable to the parameterbooleanisStringValue()Indicates whether this FHIRPathSystemValue is type compatible withFHIRPathStringValueintlength()The length of this FHIRPathStringValueFHIRPathStringValuelower()Convert the characters in this FHIRPathStringValue to lower casebooleanmatches(FHIRPathStringValue regex)Indicates whether theStringvalue wrapped by this FHIRPathStringValue matches the regex in the parameterFHIRPathStringValuereplace(FHIRPathStringValue pattern, FHIRPathStringValue substitution)Replace occurrences of pattern in this FHIRPathStringValue with substitutionFHIRPathStringValuereplaceMatches(FHIRPathStringValue regex, FHIRPathStringValue substitution)Replace matches of regex in this FHIRPathStringValue with substitutionbooleanstartsWith(FHIRPathStringValue prefix)Indicates whether this FHIRPathStringValue starts with the prefix in the parameterStringstring()TheStringvalue wrapped by this FHIRPathStringValuestatic FHIRPathStringValuestringValue(String string)Static factory method for creating FHIRPathStringValue instances from aStringvaluestatic FHIRPathStringValuestringValue(String name, String string)Static factory method for creating named FHIRPathStringValue instances from aStringvalueFHIRPathStringValuesubstring(int start)Returns the part of this FHIRPathStringValue starting at position startFHIRPathStringValuesubstring(int start, int length)Returns the part of this FHIRPathStringValue starting at position start up to length number of charactersFHIRPathStringValue.BuildertoBuilder()Convert thisFHIRPathNodeinstance into aFHIRPathNode.BuilderinstanceStringtoString()FHIRPathStringValueupper()Convert the characters in this FHIRPathStringValue to upper case-
Methods inherited from class com.ibm.fhir.path.FHIRPathAbstractNode
as, children, descendants, getValue, hasValue, is, name, path, stream, type
-
Methods inherited from interface com.ibm.fhir.path.FHIRPathNode
as, asElementNode, asResourceNode, asSystemValue, asTermServiceNode, asTypeInfoNode, children, descendants, getValue, is, isElementNode, isResourceNode, isTermServiceNode, isTypeInfoNode, name, path, stream, type
-
Methods inherited from interface com.ibm.fhir.path.FHIRPathSystemValue
asBooleanValue, asNumberValue, asQuantityValue, asStringValue, asTemporalValue, hasValue, isBooleanValue, isNumberValue, isQuantityValue, isSystemValue, isTemporalValue
-
-
-
-
Field Detail
-
EMPTY_STRING
public static final FHIRPathStringValue EMPTY_STRING
-
-
Constructor Detail
-
FHIRPathStringValue
protected FHIRPathStringValue(FHIRPathStringValue.Builder builder)
-
-
Method Detail
-
isStringValue
public boolean isStringValue()
Description copied from interface:FHIRPathSystemValueIndicates whether this FHIRPathSystemValue is type compatible withFHIRPathStringValue- Specified by:
isStringValuein interfaceFHIRPathSystemValue- Returns:
- true if this FHIRPathSystemValue is type compatible with
FHIRPathStringValue, otherwise false
-
string
public String string()
TheStringvalue wrapped by this FHIRPathStringValue- Returns:
- the
Stringvalue wrapped by this FHIRPathStringValue
-
stringValue
public static FHIRPathStringValue stringValue(String string)
Static factory method for creating FHIRPathStringValue instances from aStringvalue- Parameters:
string- theStringvalue- Returns:
- a new FHIRPathStringValue instance
-
stringValue
public static FHIRPathStringValue stringValue(String name, String string)
Static factory method for creating named FHIRPathStringValue instances from aStringvalue- Parameters:
name- the namestring- theStringvalue- Returns:
- a new named FHIRPathStringValue instance
-
toBuilder
public FHIRPathStringValue.Builder toBuilder()
Description copied from class:FHIRPathAbstractNodeConvert thisFHIRPathNodeinstance into aFHIRPathNode.Builderinstance- Specified by:
toBuilderin classFHIRPathAbstractNode- Returns:
- a new
FHIRPathNode.Builderinstance containing the fields from thisFHIRPathNodeinstance
-
builder
public static FHIRPathStringValue.Builder builder(String string)
Static factory method for creating builder instances from aStringvalue- Parameters:
string- theStringvalue- Returns:
- a new builder for building FHIRPathStringValue instances
-
concat
public FHIRPathStringValue concat(FHIRPathStringValue value)
- Parameters:
value- the other FHIRPathStringValue- Returns:
- the result of concatenation between this FHIRPathStringValue and the parameter
-
startsWith
public boolean startsWith(FHIRPathStringValue prefix)
Indicates whether this FHIRPathStringValue starts with the prefix in the parameter- Parameters:
prefix- the prefix- Returns:
- true if this FHIRPathStringValue starts with the parameter, otherwise false
-
endsWith
public boolean endsWith(FHIRPathStringValue suffix)
Indicates whether this FHIRPathStringValue ends with the suffix in the parameter- Parameters:
suffix- the suffix- Returns:
- true if this FHIRPathStringValue ends with the parameter, otherwise false
-
replace
public FHIRPathStringValue replace(FHIRPathStringValue pattern, FHIRPathStringValue substitution)
Replace occurrences of pattern in this FHIRPathStringValue with substitution- Parameters:
pattern- the patternsubstitution- the substitution- Returns:
- the result of replacing occurrences of pattern found in this FHIRPathStringValue with substitution
-
matches
public boolean matches(FHIRPathStringValue regex)
Indicates whether theStringvalue wrapped by this FHIRPathStringValue matches the regex in the parameter- Parameters:
regex- the regex- Returns:
- true if the
Stringvalue wrapped by this FHIRPathStringValue matches the regex in the parameter
-
replaceMatches
public FHIRPathStringValue replaceMatches(FHIRPathStringValue regex, FHIRPathStringValue substitution)
Replace matches of regex in this FHIRPathStringValue with substitution- Parameters:
regex- the regexsubstitution- the substitution- Returns:
- the result of replacing matches of regex in this FHIRPathStringValue with substitution
-
substring
public FHIRPathStringValue substring(int start)
Returns the part of this FHIRPathStringValue starting at position start- Parameters:
start- the start- Returns:
- the part of this FHIRPathStringValue starting at position start
-
substring
public FHIRPathStringValue substring(int start, int length)
Returns the part of this FHIRPathStringValue starting at position start up to length number of characters- Parameters:
start- the startlength- the length- Returns:
- the part of this FHIRPathStringValue starting at position start up to length number of characters
-
contains
public boolean contains(FHIRPathStringValue substring)
Indicates whether this FHIRPathStringValue contains the substring in the parameter- Parameters:
substring- the substring- Returns:
- true if this FHIRPathStringValue contains the substring in the parameter, otherwise false
-
length
public int length()
The length of this FHIRPathStringValue- Returns:
- the length of this FHIRPathStringValue
-
lower
public FHIRPathStringValue lower()
Convert the characters in this FHIRPathStringValue to lower case- Returns:
- the result of converting the characters in this FHIRPathString to lower case
-
upper
public FHIRPathStringValue upper()
Convert the characters in this FHIRPathStringValue to upper case- Returns:
- the result of converting the characters in this FHIRPathString to upper case
-
isComparableTo
public boolean isComparableTo(FHIRPathNode other)
Indicates whether this FHIRPathStringValue is comparable to the parameter- Specified by:
isComparableToin interfaceFHIRPathNode- Parameters:
other- the other FHIRPathNode- Returns:
- true if the parameter or its primitive value is a
FHIRPathStringValue, otherwise false
-
compareTo
public int compareTo(FHIRPathNode other)
Compare theStringvalue wrapped by this FHIRPathStringValue node to the parameter- Specified by:
compareToin interfaceComparable<FHIRPathNode>- Parameters:
other- the otherFHIRPathNode- Returns:
- 0 if the
Stringvalue wrapped by this FHIRPathStringValue node is equal to the parameter; a positive value if this FHIRPathStringValue if the first non-matching character is greater than the character at the same index in the parameter; a positive value if this FHIRPathStringValue if the first non-matching character is less than the character at the same index in the parameter
-
equals
public boolean equals(Object obj)
Indicates whether theStringvalue wrapped by this FHIRPathStringValue node is equal the parameter (or its primitive value)
-
accept
public void accept(FHIRPathNodeVisitor visitor)
Description copied from interface:FHIRPathNodeA method for accepting aFHIRPathNodeVisitor- Specified by:
acceptin interfaceFHIRPathNode- Parameters:
visitor- theFHIRPathNodeVisitorthat this FHIRPathNode is accepting
-
-