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
AFHIRPathElementNode
that wraps aQuantity
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FHIRPathQuantityNode.Builder
-
Field Summary
-
Fields inherited from class org.linuxforhealth.fhir.path.FHIRPathElementNode
element, tree
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
FHIRPathQuantityNode(FHIRPathQuantityNode.Builder builder)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description FHIRPathQuantityNode
add(FHIRPathQuantityNode node)
Add this FHIRPathQuantityNode to another FHIRPathQuantityNodestatic FHIRPathQuantityNode.Builder
builder(Quantity quantity)
Static factory method for creating builder instances from aQuantity
valueint
compareTo(FHIRPathNode other)
Compare the quantity value wrapped by this FHIRPathQuantityNode to the parameterboolean
equals(java.lang.Object obj)
Indicates whether the quantity value wrapped by this FHIRPathQuantityNode is equal the parameter (or its primitive value)java.lang.String
getQuantityCode()
The code of the quantity wrapped by this FHIRPathQuantityNodejava.lang.String
getQuantitySystem()
The system of the quantity wrapped by this FHIRPathQuantityNodejava.lang.String
getQuantityUnit()
The unit of the quantity wrapped by this FHIRPathQuantityNodejava.math.BigDecimal
getQuantityValue()
TheBigDecimal
value of the quantity wrapped by this FHIRPathQuantityNodeboolean
isComparableTo(FHIRPathNode other)
Indicates whether this FHIRPathQuantityNode is comparable to the parameterboolean
isQuantityNode()
Indicates whether this FHIRPathElementNode is type compatible withFHIRPathQuantityNode
Quantity
quantity()
The quantity wrapped by this FHIRPathQuantityNodeFHIRPathQuantityNode
subtract(FHIRPathQuantityNode node)
Subtract another FHIRPathQuantityNode from this FHIRPathQuantityNodejava.lang.String
toString()
-
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, type
-
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
-
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
-
getQuantityValue
public java.math.BigDecimal getQuantityValue()
TheBigDecimal
value of the quantity wrapped by this FHIRPathQuantityNode- Returns:
- the
BigDecimal
value of the quantity wrapped by this FHIRPathQuantityNode
-
isQuantityNode
public boolean isQuantityNode()
Description copied from class:FHIRPathElementNode
Indicates whether this FHIRPathElementNode is type compatible withFHIRPathQuantityNode
- Overrides:
isQuantityNode
in 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 aQuantity
value- Parameters:
quantity
- theQuantity
value- 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:
isComparableTo
in interfaceFHIRPathNode
- Overrides:
isComparableTo
in classFHIRPathElementNode
- Parameters:
other
- the otherFHIRPathNode
- Returns:
- true if the parameter or its primitive value is a FHIRPathQuantityNode, a
FHIRPathQuantityValue
or a , otherwise false
-
compareTo
public int compareTo(FHIRPathNode other)
Compare the quantity value wrapped by this FHIRPathQuantityNode to the parameter- Specified by:
compareTo
in interfacejava.lang.Comparable<FHIRPathNode>
- Overrides:
compareTo
in 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:
equals
in 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:
toString
in classFHIRPathElementNode
-
-