Package com.ibm.fhir.path
Class FHIRPathQuantityValue
- java.lang.Object
-
- com.ibm.fhir.path.FHIRPathAbstractNode
-
- com.ibm.fhir.path.FHIRPathAbstractSystemValue
-
- com.ibm.fhir.path.FHIRPathQuantityValue
-
- All Implemented Interfaces:
FHIRPathNode,FHIRPathSystemValue,java.lang.Comparable<FHIRPathNode>
public class FHIRPathQuantityValue extends FHIRPathAbstractSystemValue
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFHIRPathQuantityValue.Builder
-
Field Summary
-
Fields inherited from class com.ibm.fhir.path.FHIRPathAbstractNode
children, name, path, type
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedFHIRPathQuantityValue(FHIRPathQuantityValue.Builder builder)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(FHIRPathNodeVisitor visitor)A method for accepting aFHIRPathNodeVisitorFHIRPathQuantityValueadd(FHIRPathQuantityValue quantityValue)Add this FHIRPathQuantityValue to another FHIRPathQuantityValuestatic FHIRPathQuantityValue.Builderbuilder(java.math.BigDecimal value, java.lang.String unit)Static factory method for creating builder instances from aBigDecimalvalue andStringunitintcompareTo(FHIRPathNode other)Compare the quantity value wrapped by this FHIRPathQuantityValue to the parameterbooleanequals(java.lang.Object obj)Indicates whether theBigDecimalvalue andStringunit wrapped by this FHIRPathQuantityValue is equal the parameter (or its primitive value)inthashCode()booleanisComparableTo(FHIRPathNode other)Indicates whether this FHIRPathQuantityValue is comparable to the parameterbooleanisQuantityValue()Indicates whether this FHIRPathSystemValue is type compatible withFHIRPathQuantityValuestatic FHIRPathQuantityValuequantityValue(Quantity quantity)Static factory method for creating FHIRPathQuantityValue instances from aQuantityvaluestatic FHIRPathQuantityValuequantityValue(java.math.BigDecimal value, java.lang.String unit)Static factory method for creating FHIRPathQuantityValue instances from aBigDecimalvalue andStringunitFHIRPathQuantityValuesubtract(FHIRPathQuantityValue quantityValue)Subtract another FHIRPathQuantityValue from this FHIRPathQuantityValueFHIRPathQuantityValue.BuildertoBuilder()Convert thisFHIRPathNodeinstance into aFHIRPathNode.Builderinstancejava.lang.StringtoString()java.lang.Stringunit()TheStringunit wrapped by this FHIRPathQuantityValuejava.math.BigDecimalvalue()TheBigDecimalvalue wrapped by this FHIRPathQuantityValue-
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, isStringValue, isSystemValue, isTemporalValue
-
-
-
-
Constructor Detail
-
FHIRPathQuantityValue
protected FHIRPathQuantityValue(FHIRPathQuantityValue.Builder builder)
-
-
Method Detail
-
isQuantityValue
public boolean isQuantityValue()
Description copied from interface:FHIRPathSystemValueIndicates 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()
TheBigDecimalvalue wrapped by this FHIRPathQuantityValue- Returns:
- the
BigDecimalvalue wrapped by this FHIRPathQuantityValue
-
unit
public java.lang.String unit()
TheStringunit wrapped by this FHIRPathQuantityValue- Returns:
- the
Stringunit wrapped by this FHIRPathQuantityValue
-
quantityValue
public static FHIRPathQuantityValue quantityValue(Quantity quantity)
Static factory method for creating FHIRPathQuantityValue instances from aQuantityvalue- Parameters:
quantity- theQuantityvalue- 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 aBigDecimalvalue andStringunit- Parameters:
value- theBigDecimalvalueunit- theStringunit- Returns:
- a new FHIRPathQuantityValue instance
-
toBuilder
public FHIRPathQuantityValue.Builder toBuilder()
Description copied from class:FHIRPathAbstractNodeConvert thisFHIRPathNodeinstance into aFHIRPathNode.Builderinstance- Specified by:
toBuilderin classFHIRPathAbstractSystemValue- Returns:
- a new
FHIRPathNode.Builderinstance containing the fields from thisFHIRPathNodeinstance
-
builder
public static FHIRPathQuantityValue.Builder builder(java.math.BigDecimal value, java.lang.String unit)
Static factory method for creating builder instances from aBigDecimalvalue andStringunit- Parameters:
value- theBigDecimalvalueunit- theStringunit- 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 theBigDecimalvalue andStringunit wrapped by this FHIRPathQuantityValue is equal the parameter (or its primitive value)- Overrides:
equalsin classjava.lang.Object- Parameters:
obj- the otherObject- Returns:
- true if the
BigDecimalvalue andStringunit wrapped by this FHIRPathQuantityValue node is equal the parameter (or its primitive value), otherwise false
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
accept
public void accept(FHIRPathNodeVisitor visitor)
Description copied from interface:FHIRPathNodeA method for accepting aFHIRPathNodeVisitor- Parameters:
visitor- theFHIRPathNodeVisitorthat this FHIRPathNode is accepting
-
-