Class QuantityValueImpl
java.lang.Object
org.wikidata.wdtk.datamodel.implementation.ValueImpl
org.wikidata.wdtk.datamodel.implementation.QuantityValueImpl
- All Implemented Interfaces:
QuantityValue,Value
Jackson implementation of
QuantityValue.- Author:
- Fredo Erxleben, Antonin Delpeuch
-
Field Summary
Fields inherited from class org.wikidata.wdtk.datamodel.implementation.ValueImpl
JSON_VALUE_TYPE_ENTITY_ID, JSON_VALUE_TYPE_GLOBE_COORDINATES, JSON_VALUE_TYPE_MONOLINGUAL_TEXT, JSON_VALUE_TYPE_QUANTITY, JSON_VALUE_TYPE_STRING, JSON_VALUE_TYPE_TIME -
Constructor Summary
ConstructorsConstructorDescriptionQuantityValueImpl(BigDecimal numericValue, BigDecimal lowerBound, BigDecimal upperBound, String unit) Deprecated.supply the unit as an ItemIdValue insteadQuantityValueImpl(BigDecimal numericValue, BigDecimal lowerBound, BigDecimal upperBound, ItemIdValue unit) Constructor. -
Method Summary
Modifier and TypeMethodDescription<T> Taccept(ValueVisitor<T> valueVisitor) Accept a ValueVisitor and return its output.booleanReturns the upper bound for the numeric value of this quantity.Returns the main numeric value of this quantity.getUnit()Returns the unit of this quantity, or the string "1" if there is no unit.Returns the upper bound for the numeric value of this quantity.org.wikidata.wdtk.datamodel.implementation.QuantityValueImpl.JacksonInnerQuantitygetValue()Returns the inner value helper object.inthashCode()toString()
-
Constructor Details
-
QuantityValueImpl
public QuantityValueImpl(BigDecimal numericValue, BigDecimal lowerBound, BigDecimal upperBound, ItemIdValue unit) Constructor.- Parameters:
numericValue- the numeric value of this quantitylowerBound- the lower bound of the numeric value of this quantity or null if not setupperBound- the upper bound of the numeric value of this quantity or null if not setunit- the unit of this quantity, or null if there is no unit
-
QuantityValueImpl
@Deprecated public QuantityValueImpl(BigDecimal numericValue, BigDecimal lowerBound, BigDecimal upperBound, String unit) Deprecated.supply the unit as an ItemIdValue insteadConstructor.- Parameters:
numericValue- the numeric value of this quantitylowerBound- the lower bound of the numeric value of this quantity or null if not setupperBound- the upper bound of the numeric value of this quantity or null if not setunit- the unit of this quantity, or the empty string if there is no unit
-
-
Method Details
-
getValue
public org.wikidata.wdtk.datamodel.implementation.QuantityValueImpl.JacksonInnerQuantity getValue()Returns the inner value helper object. Only for use by Jackson during serialization.- Returns:
- the inner quantity value
-
getNumericValue
Description copied from interface:QuantityValueReturns the main numeric value of this quantity.- Specified by:
getNumericValuein interfaceQuantityValue- Returns:
- numeric value as a decimal value of arbitrary precision
-
getLowerBound
Description copied from interface:QuantityValueReturns the upper bound for the numeric value of this quantity.- Specified by:
getLowerBoundin interfaceQuantityValue- Returns:
- numeric value as a decimal value of arbitrary precision or null if not set
-
getUpperBound
Description copied from interface:QuantityValueReturns the upper bound for the numeric value of this quantity.- Specified by:
getUpperBoundin interfaceQuantityValue- Returns:
- numeric value as a decimal value of arbitrary precision or null if not set
-
getUnit
Description copied from interface:QuantityValueReturns the unit of this quantity, or the string "1" if there is no unit. Units are typically encoded as entity IRIs.- Specified by:
getUnitin interfaceQuantityValue- Returns:
- unit string (IRI or the string "1" if there is no unit)
-
getUnitItemId
- Specified by:
getUnitItemIdin interfaceQuantityValue- Returns:
- the unit of this quantity as an item id value, or null if there is no unit.
-
accept
Description copied from interface:ValueAccept a ValueVisitor and return its output. -
hashCode
public int hashCode() -
equals
-
toString
-