Enum Class QapiDatamart.Options

All Implemented Interfaces:
Serializable, Comparable<QapiDatamart.Options>, Constable
Enclosing interface:
QapiDatamart

public static enum QapiDatamart.Options extends Enum<QapiDatamart.Options>
Options of api.queryApi().tables().datamart(String, Map), which convert the values of the Datamart when they are read. Each option takes a String code as its value.

Example, prices in euros and quantities in boxes:


 import net.pricefx.formulaengine.scripting.queryapi.tables.QapiDatamart

 def q = api.queryApi()
 def dm = q.tables().datamart("TransactionsDM", [
         (QapiDatamart.Options.CURRENCY): "EUR",
         (QapiDatamart.Options.UOM)     : "BOX",
 ])

 return q.source(dm, [dm.price, dm.quantity]).stream { it.toList() }
 
See Also:
  • Enum Constant Details

    • CURRENCY

      public static final QapiDatamart.Options CURRENCY
      The currency code that the money fields are converted to, for example "EUR". The conversion uses the rates of the ccy Data Source.
    • UOM

      public static final QapiDatamart.Options UOM
      The unit of measure code that the quantity fields are converted to, for example "BOX". The conversion uses the rates of the uom Data Source.
  • Method Details

    • values

      public static QapiDatamart.Options[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static QapiDatamart.Options valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null