Package com.ibm.fhir.path
Class FHIRPathStringValue
- java.lang.Object
-
- com.ibm.fhir.path.FHIRPathAbstractNode
-
- com.ibm.fhir.path.FHIRPathAbstractSystemValue
-
- com.ibm.fhir.path.FHIRPathStringValue
-
- All Implemented Interfaces:
FHIRPathNode
,FHIRPathSystemValue
,java.lang.Comparable<FHIRPathNode>
public class FHIRPathStringValue extends FHIRPathAbstractSystemValue
AFHIRPathSystemValue
node that wraps aString
value
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FHIRPathStringValue.Builder
-
Field Summary
Fields Modifier and Type Field Description static FHIRPathStringValue
EMPTY_STRING
-
Constructor Summary
Constructors Modifier Constructor Description protected
FHIRPathStringValue(FHIRPathStringValue.Builder builder)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(FHIRPathNodeVisitor visitor)
A method for accepting aFHIRPathNodeVisitor
static FHIRPathStringValue.Builder
builder(java.lang.String string)
Static factory method for creating builder instances from aString
valueint
compareTo(FHIRPathNode other)
Compare theString
value wrapped by this FHIRPathStringValue node to the parameterFHIRPathStringValue
concat(FHIRPathStringValue value)
Concatenate theString
value with theString
value wrapped by another FHIRPathStringValueboolean
contains(FHIRPathStringValue substring)
Indicates whether this FHIRPathStringValue contains the substring in the parameterboolean
endsWith(FHIRPathStringValue suffix)
Indicates whether this FHIRPathStringValue ends with the suffix in the parameterboolean
equals(java.lang.Object obj)
Indicates whether theString
value wrapped by this FHIRPathStringValue node is equal the parameter (or its primitive value)int
hashCode()
boolean
isComparableTo(FHIRPathNode other)
Indicates whether this FHIRPathStringValue is comparable to the parameterboolean
isStringValue()
Indicates whether this FHIRPathSystemValue is type compatible withFHIRPathStringValue
int
length()
The length of this FHIRPathStringValueFHIRPathStringValue
lower()
Convert the characters in this FHIRPathStringValue to lower caseboolean
matches(FHIRPathStringValue regex)
Indicates whether theString
value wrapped by this FHIRPathStringValue matches the regex in the parameterFHIRPathStringValue
replace(FHIRPathStringValue pattern, FHIRPathStringValue substitution)
Replace occurrences of pattern in this FHIRPathStringValue with substitutionFHIRPathStringValue
replaceMatches(FHIRPathStringValue regex, FHIRPathStringValue substitution)
Replace matches of regex in this FHIRPathStringValue with substitutionboolean
startsWith(FHIRPathStringValue prefix)
Indicates whether this FHIRPathStringValue starts with the prefix in the parameterjava.lang.String
string()
TheString
value wrapped by this FHIRPathStringValuestatic FHIRPathStringValue
stringValue(java.lang.String string)
Static factory method for creating FHIRPathStringValue instances from aString
valuestatic FHIRPathStringValue
stringValue(java.lang.String name, java.lang.String string)
Static factory method for creating named FHIRPathStringValue instances from aString
valueFHIRPathStringValue
substring(int start)
Returns the part of this FHIRPathStringValue starting at position startFHIRPathStringValue
substring(int start, int length)
Returns the part of this FHIRPathStringValue starting at position start up to length number of charactersFHIRPathStringValue.Builder
toBuilder()
Convert thisFHIRPathNode
instance into aFHIRPathNode.Builder
instancejava.lang.String
toString()
FHIRPathStringValue
upper()
Convert the characters in this FHIRPathStringValue to upper case-
Methods inherited from class com.ibm.fhir.path.FHIRPathAbstractSystemValue
children, descendants, getValue, hasValue, stream
-
Methods inherited from interface com.ibm.fhir.path.FHIRPathNode
as, asElementNode, asResourceNode, asSystemValue, asTermServiceNode, asTypeInfoNode, is, isElementNode, isResourceNode, isTermServiceNode, isTypeInfoNode, name, path, type
-
Methods inherited from interface com.ibm.fhir.path.FHIRPathSystemValue
asBooleanValue, asNumberValue, asQuantityValue, asStringValue, asTemporalValue, 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:FHIRPathSystemValue
Indicates whether this FHIRPathSystemValue is type compatible withFHIRPathStringValue
- Returns:
- true if this FHIRPathSystemValue is type compatible with
FHIRPathStringValue
, otherwise false
-
string
public java.lang.String string()
TheString
value wrapped by this FHIRPathStringValue- Returns:
- the
String
value wrapped by this FHIRPathStringValue
-
stringValue
public static FHIRPathStringValue stringValue(java.lang.String string)
Static factory method for creating FHIRPathStringValue instances from aString
value- Parameters:
string
- theString
value- Returns:
- a new FHIRPathStringValue instance
-
stringValue
public static FHIRPathStringValue stringValue(java.lang.String name, java.lang.String string)
Static factory method for creating named FHIRPathStringValue instances from aString
value- Parameters:
name
- the namestring
- theString
value- Returns:
- a new named FHIRPathStringValue instance
-
toBuilder
public FHIRPathStringValue.Builder toBuilder()
Description copied from class:FHIRPathAbstractNode
Convert thisFHIRPathNode
instance into aFHIRPathNode.Builder
instance- Specified by:
toBuilder
in classFHIRPathAbstractSystemValue
- Returns:
- a new
FHIRPathNode.Builder
instance containing the fields from thisFHIRPathNode
instance
-
builder
public static FHIRPathStringValue.Builder builder(java.lang.String string)
Static factory method for creating builder instances from aString
value- Parameters:
string
- theString
value- Returns:
- a new builder for building FHIRPathStringValue instances
-
concat
public FHIRPathStringValue concat(FHIRPathStringValue value)
Concatenate theString
value with theString
value wrapped by another FHIRPathStringValue- 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 theString
value wrapped by this FHIRPathStringValue matches the regex in the parameter- Parameters:
regex
- the regex- Returns:
- true if the
String
value 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- 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 theString
value wrapped by this FHIRPathStringValue node to the parameter- Parameters:
other
- the otherFHIRPathNode
- Returns:
- 0 if the
String
value 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(java.lang.Object obj)
Indicates whether theString
value wrapped by this FHIRPathStringValue node is equal the parameter (or its primitive value)- Overrides:
equals
in classjava.lang.Object
- Parameters:
obj
- the otherObject
- Returns:
- true if the
String
value wrapped by this FHIRPathStringValue node is equal the parameter (or its primitive value), otherwise false
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
accept
public void accept(FHIRPathNodeVisitor visitor)
Description copied from interface:FHIRPathNode
A method for accepting aFHIRPathNodeVisitor
- Parameters:
visitor
- theFHIRPathNodeVisitor
that this FHIRPathNode is accepting
-
-