Package org.linuxforhealth.fhir.path
Class FHIRPathQuantityValue
- java.lang.Object
-
- org.linuxforhealth.fhir.path.FHIRPathAbstractNode
-
- org.linuxforhealth.fhir.path.FHIRPathAbstractSystemValue
-
- org.linuxforhealth.fhir.path.FHIRPathQuantityValue
-
- All Implemented Interfaces:
java.lang.Comparable<FHIRPathNode>
,FHIRPathNode
,FHIRPathSystemValue
public class FHIRPathQuantityValue extends FHIRPathAbstractSystemValue
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FHIRPathQuantityValue.Builder
-
Field Summary
-
Fields inherited from class org.linuxforhealth.fhir.path.FHIRPathAbstractNode
children, name, path, type
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
FHIRPathQuantityValue(FHIRPathQuantityValue.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
FHIRPathQuantityValue
add(FHIRPathQuantityValue quantityValue)
Add this FHIRPathQuantityValue to another FHIRPathQuantityValuestatic FHIRPathQuantityValue.Builder
builder(java.math.BigDecimal value, java.lang.String unit)
Static factory method for creating builder instances from aBigDecimal
value andString
unitint
compareTo(FHIRPathNode other)
Compare the quantity value wrapped by this FHIRPathQuantityValue to the parameterboolean
equals(java.lang.Object obj)
Indicates whether theBigDecimal
value andString
unit wrapped by this FHIRPathQuantityValue is equal the parameter (or its primitive value)int
hashCode()
boolean
isComparableTo(FHIRPathNode other)
Indicates whether this FHIRPathQuantityValue is comparable to the parameterboolean
isQuantityValue()
Indicates whether this FHIRPathSystemValue is type compatible withFHIRPathQuantityValue
static FHIRPathQuantityValue
quantityValue(java.math.BigDecimal value, java.lang.String unit)
Static factory method for creating FHIRPathQuantityValue instances from aBigDecimal
value andString
unitstatic FHIRPathQuantityValue
quantityValue(Quantity quantity)
Static factory method for creating FHIRPathQuantityValue instances from aQuantity
valueFHIRPathQuantityValue
subtract(FHIRPathQuantityValue quantityValue)
Subtract another FHIRPathQuantityValue from this FHIRPathQuantityValueFHIRPathQuantityValue.Builder
toBuilder()
Convert thisFHIRPathNode
instance into aFHIRPathNode.Builder
instancejava.lang.String
toString()
java.lang.String
unit()
TheString
unit wrapped by this FHIRPathQuantityValuejava.math.BigDecimal
value()
TheBigDecimal
value wrapped by this FHIRPathQuantityValue-
Methods inherited from class org.linuxforhealth.fhir.path.FHIRPathAbstractSystemValue
children, descendants, stream
-
Methods inherited from class org.linuxforhealth.fhir.path.FHIRPathAbstractNode
as, getValue, hasValue, is, name, path, type
-
Methods inherited from interface org.linuxforhealth.fhir.path.FHIRPathNode
as, asElementNode, asResourceNode, asSystemValue, asTermServiceNode, asTypeInfoNode, is, isElementNode, isResourceNode, isTermServiceNode, isTypeInfoNode, name, path, type
-
Methods inherited from interface org.linuxforhealth.fhir.path.FHIRPathSystemValue
asBooleanValue, asNumberValue, asQuantityValue, asStringValue, asTemporalValue, getValue, hasValue, isBooleanValue, isNumberValue, isStringValue, isSystemValue, isTemporalValue
-
-
-
-
Constructor Detail
-
FHIRPathQuantityValue
protected FHIRPathQuantityValue(FHIRPathQuantityValue.Builder builder)
-
-
Method Detail
-
isQuantityValue
public boolean isQuantityValue()
Description copied from interface:FHIRPathSystemValue
Indicates whether this FHIRPathSystemValue is type compatible withFHIRPathQuantityValue
- Returns:
- true if this FHIRPathSystemValue is type compatible with
FHIRPathQuantityValue
, otherwise false
-
value
public java.math.BigDecimal value()
TheBigDecimal
value wrapped by this FHIRPathQuantityValue- Returns:
- the
BigDecimal
value wrapped by this FHIRPathQuantityValue
-
unit
public java.lang.String unit()
TheString
unit wrapped by this FHIRPathQuantityValue- Returns:
- the
String
unit wrapped by this FHIRPathQuantityValue
-
quantityValue
public static FHIRPathQuantityValue quantityValue(Quantity quantity)
Static factory method for creating FHIRPathQuantityValue instances from aQuantity
value- Parameters:
quantity
- theQuantity
value- Returns:
- a new FHIRPathQuantityValue instance
-
quantityValue
public static FHIRPathQuantityValue quantityValue(java.math.BigDecimal value, java.lang.String unit)
Static factory method for creating FHIRPathQuantityValue instances from aBigDecimal
value andString
unit- Parameters:
value
- theBigDecimal
valueunit
- theString
unit- Returns:
- a new FHIRPathQuantityValue instance
-
toBuilder
public FHIRPathQuantityValue.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 FHIRPathQuantityValue.Builder builder(java.math.BigDecimal value, java.lang.String unit)
Static factory method for creating builder instances from aBigDecimal
value andString
unit- Parameters:
value
- theBigDecimal
valueunit
- theString
unit- Returns:
- a new builder for building FHIRPathQuantityValue instances
-
add
public FHIRPathQuantityValue add(FHIRPathQuantityValue quantityValue)
Add this FHIRPathQuantityValue to another FHIRPathQuantityValue- Parameters:
quantityValue
- the other FHIRPathQuantityValue- Returns:
- the result of adding this FHIRPathQuantityValue to another FHIRPathQuantityValue
-
subtract
public FHIRPathQuantityValue subtract(FHIRPathQuantityValue quantityValue)
Subtract another FHIRPathQuantityValue from this FHIRPathQuantityValue- Parameters:
quantityValue
- the other FHIRPathQuantityValue- Returns:
- the result of subtracting another FHIRPathQuantityValue from this FHIRPathQuantityValue
-
isComparableTo
public boolean isComparableTo(FHIRPathNode other)
Indicates whether this FHIRPathQuantityValue is comparable to the parameter- Parameters:
other
- the other FHIRPathNode- Returns:
- true if the parameter or its primitive value is a FHIRPathQuantityValue or a , otherwise false
-
compareTo
public int compareTo(FHIRPathNode other)
Compare the quantity value wrapped by this FHIRPathQuantityValue to the parameter- Parameters:
other
- the otherFHIRPathNode
- Returns:
- 0 if the quantity value wrapped by this FHIRPathQuantityValue is equal to the parameter; a positive value if this FHIRPathQuantityValue is greater than the parameter; and a negative value if this FHIRPathQuantityValue is less than the parameter
-
equals
public boolean equals(java.lang.Object obj)
Indicates whether theBigDecimal
value andString
unit wrapped by this FHIRPathQuantityValue is equal the parameter (or its primitive value)- Overrides:
equals
in classjava.lang.Object
- Parameters:
obj
- the otherObject
- Returns:
- true if the
BigDecimal
value andString
unit wrapped by this FHIRPathQuantityValue 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
-
-