Package com.ibm.fhir.path
Class FHIRPathQuantityValue
- java.lang.Object
-
- com.ibm.fhir.path.FHIRPathAbstractNode
-
- com.ibm.fhir.path.FHIRPathQuantityValue
-
- All Implemented Interfaces:
FHIRPathNode,FHIRPathSystemValue,Comparable<FHIRPathNode>
public class FHIRPathQuantityValue extends FHIRPathAbstractNode implements FHIRPathSystemValue
-
-
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(BigDecimal value, 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(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(BigDecimal value, 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.BuilderinstanceStringtoString()Stringunit()TheStringunit wrapped by this FHIRPathQuantityValueBigDecimalvalue()TheBigDecimalvalue wrapped by this FHIRPathQuantityValue-
Methods inherited from class com.ibm.fhir.path.FHIRPathAbstractNode
as, children, descendants, getValue, hasValue, is, name, path, stream, type
-
Methods inherited from interface com.ibm.fhir.path.FHIRPathNode
as, asElementNode, asResourceNode, asSystemValue, asTermServiceNode, asTypeInfoNode, children, descendants, getValue, is, isElementNode, isResourceNode, isTermServiceNode, isTypeInfoNode, name, path, stream, type
-
Methods inherited from interface com.ibm.fhir.path.FHIRPathSystemValue
asBooleanValue, asNumberValue, asQuantityValue, asStringValue, asTemporalValue, hasValue, 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- Specified by:
isQuantityValuein interfaceFHIRPathSystemValue- Returns:
- true if this FHIRPathSystemValue is type compatible with
FHIRPathQuantityValue, otherwise false
-
value
public BigDecimal value()
TheBigDecimalvalue wrapped by this FHIRPathQuantityValue- Returns:
- the
BigDecimalvalue wrapped by this FHIRPathQuantityValue
-
unit
public 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(BigDecimal value, 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 classFHIRPathAbstractNode- Returns:
- a new
FHIRPathNode.Builderinstance containing the fields from thisFHIRPathNodeinstance
-
builder
public static FHIRPathQuantityValue.Builder builder(BigDecimal value, 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- Specified by:
isComparableToin interfaceFHIRPathNode- 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- Specified by:
compareToin interfaceComparable<FHIRPathNode>- 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(Object obj)
Indicates whether theBigDecimalvalue andStringunit wrapped by this FHIRPathQuantityValue is equal the parameter (or its primitive value)- Overrides:
equalsin classObject- 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
-
accept
public void accept(FHIRPathNodeVisitor visitor)
Description copied from interface:FHIRPathNodeA method for accepting aFHIRPathNodeVisitor- Specified by:
acceptin interfaceFHIRPathNode- Parameters:
visitor- theFHIRPathNodeVisitorthat this FHIRPathNode is accepting
-
-