Package org.linuxforhealth.fhir.path
Class FHIRPathQuantityNode
- java.lang.Object
-
- org.linuxforhealth.fhir.path.FHIRPathAbstractNode
-
- org.linuxforhealth.fhir.path.FHIRPathElementNode
-
- org.linuxforhealth.fhir.path.FHIRPathQuantityNode
-
- All Implemented Interfaces:
java.lang.Comparable<FHIRPathNode>,FHIRPathNode
public class FHIRPathQuantityNode extends FHIRPathElementNode
AFHIRPathElementNodethat wraps aQuantity
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFHIRPathQuantityNode.Builderstatic classFHIRPathQuantityNode.QuantitySubTypeEnum for all the sub types of Quantity data type
-
Field Summary
-
Fields inherited from class org.linuxforhealth.fhir.path.FHIRPathElementNode
element, tree
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedFHIRPathQuantityNode(FHIRPathQuantityNode.Builder builder)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description FHIRPathQuantityNodeadd(FHIRPathQuantityNode node)Add this FHIRPathQuantityNode to another FHIRPathQuantityNodestatic FHIRPathQuantityNode.Builderbuilder(Quantity quantity)Static factory method for creating builder instances from aQuantityvalueintcompareTo(FHIRPathNode other)Compare the quantity value wrapped by this FHIRPathQuantityNode to the parameterbooleanequals(java.lang.Object obj)Indicates whether the quantity value wrapped by this FHIRPathQuantityNode is equal the parameter (or its primitive value)java.lang.StringgetQuantityCode()The code of the quantity wrapped by this FHIRPathQuantityNodeFHIRPathQuantityNode.QuantitySubTypegetQuantitySubType()Method to return the QuantitySubType wrapped by this FHIRPathQuantityNode.java.lang.StringgetQuantitySystem()The system of the quantity wrapped by this FHIRPathQuantityNodejava.lang.StringgetQuantityUnit()The unit of the quantity wrapped by this FHIRPathQuantityNodejava.math.BigDecimalgetQuantityValue()TheBigDecimalvalue of the quantity wrapped by this FHIRPathQuantityNodebooleanisComparableTo(FHIRPathNode other)Indicates whether this FHIRPathQuantityNode is comparable to the parameterbooleanisQuantityNode()Indicates whether this FHIRPathElementNode is type compatible withFHIRPathQuantityNodeQuantityquantity()The quantity wrapped by this FHIRPathQuantityNodeFHIRPathQuantityNodesubtract(FHIRPathQuantityNode node)Subtract another FHIRPathQuantityNode from this FHIRPathQuantityNodejava.lang.StringtoString()FHIRPathTypetype()The type of this FHIRPathNode-
Methods inherited from class org.linuxforhealth.fhir.path.FHIRPathElementNode
accept, asQuantityNode, builder, element, elementNode, elementNode, getTree, hashCode, isElementNode, toBuilder
-
Methods inherited from class org.linuxforhealth.fhir.path.FHIRPathAbstractNode
as, children, descendants, getValue, hasValue, is, name, path, stream
-
Methods inherited from interface org.linuxforhealth.fhir.path.FHIRPathNode
asElementNode, asResourceNode, asSystemValue, asTermServiceNode, asTypeInfoNode, isResourceNode, isSystemValue, isTermServiceNode, isTypeInfoNode
-
-
-
-
Constructor Detail
-
FHIRPathQuantityNode
protected FHIRPathQuantityNode(FHIRPathQuantityNode.Builder builder)
-
-
Method Detail
-
getQuantitySubType
public FHIRPathQuantityNode.QuantitySubType getQuantitySubType()
Method to return the QuantitySubType wrapped by this FHIRPathQuantityNode.- Returns:
- the QuantitySubType wrapped by this FHIRPathQuantityNode (if there is one), otherwise null.
-
quantity
public Quantity quantity()
The quantity wrapped by this FHIRPathQuantityNode- Returns:
- the quantity wrapped by this FHIRPathQuantityNode
-
getQuantitySystem
public java.lang.String getQuantitySystem()
The system of the quantity wrapped by this FHIRPathQuantityNode- Returns:
- the system of the quantity wrapped by this FHIRPathQuantityNode
-
getQuantityCode
public java.lang.String getQuantityCode()
The code of the quantity wrapped by this FHIRPathQuantityNode- Returns:
- the code of the quantity wrapped by this FHIRPathQuantityNode
-
getQuantityUnit
public java.lang.String getQuantityUnit()
The unit of the quantity wrapped by this FHIRPathQuantityNode- Returns:
- the unit of the quantity wrapped by this FHIRPathQuantityNode
-
type
public FHIRPathType type()
Description copied from interface:FHIRPathNodeThe type of this FHIRPathNode- Specified by:
typein interfaceFHIRPathNode- Overrides:
typein classFHIRPathAbstractNode- Returns:
- the type of this FHIRPathNode
-
getQuantityValue
public java.math.BigDecimal getQuantityValue()
TheBigDecimalvalue of the quantity wrapped by this FHIRPathQuantityNode- Returns:
- the
BigDecimalvalue of the quantity wrapped by this FHIRPathQuantityNode
-
isQuantityNode
public boolean isQuantityNode()
Description copied from class:FHIRPathElementNodeIndicates whether this FHIRPathElementNode is type compatible withFHIRPathQuantityNode- Overrides:
isQuantityNodein classFHIRPathElementNode- Returns:
- true if this FHIRPathElementNode is type compatible with
FHIRPathQuantityNode, otherwise false
-
builder
public static FHIRPathQuantityNode.Builder builder(Quantity quantity)
Static factory method for creating builder instances from aQuantityvalue- Parameters:
quantity- theQuantityvalue- Returns:
- a new builder for building FHIRPathQuantityNode instances
-
add
public FHIRPathQuantityNode add(FHIRPathQuantityNode node)
Add this FHIRPathQuantityNode to another FHIRPathQuantityNode- Parameters:
node- the other FHIRPathQuantityNode- Returns:
- the result of adding this FHIRPathQuantityNode to another FHIRPathQuantityNode
-
subtract
public FHIRPathQuantityNode subtract(FHIRPathQuantityNode node)
Subtract another FHIRPathQuantityNode from this FHIRPathQuantityNode- Parameters:
node- the other FHIRPathQuantityNode- Returns:
- the result of subtracting another FHIRPathQuantityNode from this FHIRPathQuantityNode
-
isComparableTo
public boolean isComparableTo(FHIRPathNode other)
Indicates whether this FHIRPathQuantityNode is comparable to the parameter- Specified by:
isComparableToin interfaceFHIRPathNode- Overrides:
isComparableToin classFHIRPathElementNode- Parameters:
other- the otherFHIRPathNode- Returns:
- true if the parameter or its primitive value is a FHIRPathQuantityNode, a
FHIRPathQuantityValueor a , otherwise false
-
compareTo
public int compareTo(FHIRPathNode other)
Compare the quantity value wrapped by this FHIRPathQuantityNode to the parameter- Specified by:
compareToin interfacejava.lang.Comparable<FHIRPathNode>- Overrides:
compareToin classFHIRPathElementNode- Parameters:
other- the otherFHIRPathNode- Returns:
- 0 if the quantity value wrapped by this FHIRPathQuantity is equal to the parameter; a positive value if this FHIRPathQuantityNode is greater than the parameter; and a negative value if this FHIRPathQuantityNode is less than the parameter
-
equals
public boolean equals(java.lang.Object obj)
Indicates whether the quantity value wrapped by this FHIRPathQuantityNode is equal the parameter (or its primitive value)- Overrides:
equalsin classFHIRPathElementNode- Parameters:
obj- the otherObject- Returns:
- true if the quantity value wrapped by this FHIRPathQuantityNode node is equal the parameter (or its primitive value), otherwise false
-
toString
public java.lang.String toString()
- Overrides:
toStringin classFHIRPathElementNode
-
-