Class WbQuantityExpr

  • All Implemented Interfaces:

    public class WbQuantityExpr
    extends Object
    implements WbExpression<org.wikidata.wdtk.datamodel.interfaces.QuantityValue>
    • Constructor Detail

      • WbQuantityExpr

        public WbQuantityExpr​(WbExpression<? extends org.wikidata.wdtk.datamodel.interfaces.StringValue> amountExpr,
                              WbExpression<? extends org.wikidata.wdtk.datamodel.interfaces.ItemIdValue> unitExpr)
        Creates an expression for a quantity, which contains two sub-expressions: one for the amount (a string with a particular format) and one for the unit, which is optional. Setting unitExpr to null will give quantities without units. Setting it to a non-null value will make the unit mandatory: if the unit expression fails to evaluate, the whole quantity expression will fail too.