Class ParsedOp

All Implemented Interfaces:
NBComponent, NBComponentAdvisors, NBComponentEvents, NBComponentMetrics, NBComponentProps, NBComponentServices, NBComponentTimeline, NBProviderSearch, NBTokenWords, DynamicFieldReader, StaticFieldReader, NBLabeledElement, AutoCloseable, LongFunction<Map<String,?>>

ParsedOp API

This is the primary developer-focused API for driver developers to use when up-converting op templates to operations. This ParsedOp is a wrapper around the op template structure. It provides many ways of constructing higher-order objects from a variety of sources.

Supporting Variety

For some drivers or protocols, the primary user interface is a statement format or grammar. For CQL or SQL, the most natural way of describing templates for operations is in that native format. For others, an operation template may look like a block of JSON or a HTTP request. All these forms are supported. In order to deal with the variety, there is a set of detailed rules for how the workload definitions are transformed into driver operations for a native driver. The high-level flow is:

  1. Op Template Form
  2. Normalized Data Structure
  3. ParsedOp Form

The specifications govern how the raw op template form is transformed into the normalized data structure. This documentation focuses on the API provided by the last form, this class, although peripheral awareness of the first two forms will certainly help for any advanced scenarios. You can find detailed examples and specification tests under the workload_definition folder of the adapters-api module.


Op Template Parsing

  1. Rule #1: All op templates are parsed into an internal normalized structure which contains:
    1. A map of op fields, which can consist of:
      1. static field values
      2. dynamic field values, the actual value of which can only be known for a given cycle
    2. Access to auxiliary configuration values like activity parameters. These can back-fill when values aren't present in the direct static or dynamic op fields.
    3. Rule #2: When asking for a dynamic parameter, static parameters may be automatically promoted to functional form as a back-fill.
    4. Rule #3: When asking for static parameters, config parameters may automatically be promoted as a back-fill.
    The net effect of these rules is that the NoSQLBench driver developer may safely use functional forms to access data in the op template, or may decide that certain op fields must only be provided in a static way per operation.


    Distinguishing Op Payload from Op Config

    When a user specifies an op template, they may choose to provide only a single set of op fields without distinguishing between config or payload, or they may choose to directly configure each.

    
    ops:
    
    # both op and params explicitly named
    op1:
    op:
    opfield1: value1
    params:
    param2: value2
    
    # neither op field nor params named, so all assumed to be op fields
    op2:
    opfield1: value1
    param2: value2
    
    # in this case, if param2 is meant to be config level,
    # it is a likely config error that should be thrown to the user
    # only op field explicitly named, so remainder automatically pushed into params
    op3:
    op:
    opfield1: value1
    param2: value2
    
    # only params explicitly named, so remainder pushed into op payload
    op4:
    params:
    param2: value2
    opfield1: value1
    

    All of these are considered valid constructions, and all of them may actually achieve the same result. This looks like an undesirable problem, but it serves to simplify things for users in one specific way: It allows them to be a vague, within guidelines, and still have a valid workload definition. The NoSQLBench runtime does a non-trivial amount of processing on the op template to ensure that it can conform to an unambiguous normalized internal structure on your behalf. This is needed because of how awful YAML is as a user configuration language in spite of its ubiquity in practice. The basic design guideline for these forms is that the op template must mean what a reasonable user would assume without looking at any documentation.


    Design Invariants

    The above rules imply invariants, which are made explicit here.

    Single Purpose Fields

    You may not use an op field name or parameter name for more than one purpose.

    Shared Namespace

    Treat all parameters supported by a driver adapter and it's op fields as a globally shared namespace, even if it is not.

    This avoids creating any confusion about what a parameter can be used for and how to use it for the right thing in the right place. For example, you may not use the parameter name `socket` in an op template to mean one thing and then use it at the driver adapter level to mean something different. However, if the meaning is congruent, a driver developer may choose to support some cross-cutting parameters at the activity level. These allowances are explicit, however, as each driver dictates what it will allow as activity parameters.

    Layered Resolution

    Users may specify op payload fields within op params or activity params as fallback config sources in that order.

    • IF a name is valid as an op field, it must also be valid as such when specified in op params.
    • If a name is valid as an op field, it must also be valid as such when specified in activity params, within the scope of ParsedOp
    • When an op field is found via op params or activity params, it may NOT be dynamic. If dynamic values are intended to be provided at a common layer in the workload, then bindings or template variables support this already.
  2. Configuration Fields

    You must access non-payload params via Config-oriented methods.
    • Op Templates contain op payload data and op configs (params, activity params).
    • You must use only ParsedOp getters with "...Config..." names, such as getConfigOr(String, Object, long) when accessing non-payload fields.
    • When a dynamic value is found via one of these calls, an error should be thrown, as configuration level data is not expected to be variant per-operation or cycle.

    Sanity Checks

    The user must be warned when a required or optional config value is missing from op params (or activity params), but a value of the same name is found in op payload fields. If rule #1 is followed, and names are unambiguous across the driver, then it is almost certainly a configuration error.

    Precedence

    The order of precedence for values is:

    • op payload fields
    • op param fields
    • activity params (when enabled, see below)

    Enabling Activity Params

    If a user wants to allow an activity param as an default for an fields, they must publish the op field name in the configuration model for the activity. Otherwise it is an error to specify the value at the activity level.


    Op Payload Forms

    Field values can come from multiple sources. These forms and any of their combinations are supported.

    Static Op Fields

    
    op:
    field1: value1
    field2:
    map3:
    key4: value4
    map5:
    key6: value6
    field7: false
    field8: 8.8
    

    As shown, any literal value of any valid YAML type, including structured values like lists or maps are accepted as static op template values. A static value is any value which contains zero bind points at any level.

    Dynamic Op Fields with Binding References

    
    op:
    field1: "{binding1}"
    field2: "value is: {binding1}"
    
     

    In this form, {binding1} is known as a binding reference, since the binding function is defined elsewhere under the given name. The first field "field1" is specified with no leading nor trailing literals, and is thus taken as a raw binding reference, meaning that it will not be converted to a String. The second, named "field2", is what is known as a string template, and is syntactical sugar for a more complex binding which concatenates static and dynamic parts together. In this form, object types produced by binding functions are converted to string form before concatenation.

    Note that a raw {binding1} value (without quotes) would be NOT be a binding reference, since YAML is a superset of JSON. this means that {binding1} would be converted to a map or JSON object type with invalid contents. This is warned about when detected as a null valued map key, although it also makes null values invalid for ANY op template value.

    Dynamic Op Fields with Binding Definitions

    
    op:
    field1: "{{NumberNameToString()}}"
    field2: "value is: {{NumberNameToString()}}"
    
     

    This form has exactly the same effect as the previous example as long as your bindings definitions included:

    
    bindings:
    binding1: NumberNameToString();
    

    Dynamic Op Fields with Structure

    
    op:
    field1:
    k1: "{binding1}
    k2: "literal value"
    field2:
    - "value3"
    - "{binding4}"
    - "a value: {binding5}"
    - "{{NumberNameToString}}"
    - "a value: {{NumberNameToString()}}"
    

    This example combines the previous ones with structure and dynamic values. Both field1 and field2 are dynamic, since each contains some dynamic value or template within. When field1 is accessed within a cycle, that cycle's value will be used as the seed to generate equivalent structures with all the literal and dynamic elements inserted as the template implies. As before, direct binding references like {binding4} will be inserted into the structure with whatever type the binding definition produces, so if you want strings in them, ensure that you configure your binding definitions thusly.

    Op Template Params

    
    params:
    prepared: true
    ops:
    op1:
    field1: value1
    params:
    prepared: false
    

    The params section are the first layer of external configuration values that an op template can use to distinguish op configuration parameters from op payload content. Op Template Params are referenced when any of the getConfigOr(String, Object, long) or other ...Config... getters are used (bypassing non-param fields). They are also accessed as a fallback when no static nor dynamic value is found for a reference op template field. Unlike op fields, op params cascade from within the workload YAML from the document level, down to each block and then down to each statement.

    Activity Params

    
    ./nb run driver=... workload=... cl=LOCAL_QUORUM
    

    When explicitly allowed by a driver adapter's configuration model, values like cl above can be seen as another fallback source for configuration parameters. The ParsedOp implementation will automatically look in the activity parameters if needed to find a missing configuration parameter, but this will only work if the specific named parameter is allowed at the activity level.


    Alternate Names

    Sometimes you may need to support more than one name for the same purpose. In such cases, there are helper methods which can be used to reduce from a set of possible field names to a single one.

  • Constructor Details

    • ParsedOp

      public ParsedOp(OpTemplate opTemplate, NBConfiguration activityCfg, List<Function<Map<String,Object>,Map<String,Object>>> preprocessors, NBComponent parent)
      Create a parsed command from an Op template. This version is exactly like except that it allows preprocessors. Preprocessors are all applied to the the op template before it is applied to the parsed command fields, allowing you to combine or destructure fields from more tha one representation into a single canonical representation for processing.
      Parameters:
      opTemplate - The OpTemplate as provided by a user via YAML, JSON, or API (data structure)
      activityCfg - The activity configuration, used to resolve nested config parameters
      preprocessors - Map->Map transformers.
  • Method Details

    • getName

      public String getName()
    • getTemplateMap

      public ParsedTemplateMap getTemplateMap()
    • apply

      public Map<String,Object> apply(long value)
      Specified by:
      apply in interface LongFunction<Map<String,?>>
    • isDynamic

      public boolean isDynamic(String field)
      Specified by:
      isDynamic in interface DynamicFieldReader
    • isStatic

      public boolean isStatic(String field)
      Parameters:
      field - The field name to look for in the static field map.
      Returns:
      true if and only if the named field is present in the static field map.
    • isStatic

      public boolean isStatic(String field, Class<?> type)
    • isDefined

      public boolean isDefined(String... fields)
      Specified by:
      isDefined in interface StaticFieldReader
      Parameters:
      fields - Names of fields to look for in the static field map.
      Returns:
      true if and only if all provided field names are present in the static field map.
    • getStaticValue

      public <T> T getStaticValue(String field, Class<T> classOfT)
      Get the static value for the provided name, cast to the required type.
      Specified by:
      getStaticValue in interface StaticFieldReader
      Type Parameters:
      T - The parameter type of the return type, used at compile time only to qualify asserted return type
      Parameters:
      field - Name of the field to get
      classOfT - The type of the field to return. If actual type is not compatible to a cast to this type, then a casting error will be thrown.
      Returns:
      A value of type T, or null
    • getStaticValue

      public <T> T getStaticValue(String field)
      Get the static value for the provided name, cast to the required type, where the type is inferred from the calling context.
      Specified by:
      getStaticValue in interface StaticFieldReader
      Type Parameters:
      T - The parameter type of the return type. used at compile time only to quality return type.
      Parameters:
      field - Name of the field to get
      Returns:
      A value of type T, or null
    • getAsTemplate

      public Optional<ParsedTemplateString> getAsTemplate(String fieldname)
    • takeAsOptionalStringTemplate

      public Optional<ParsedTemplateString> takeAsOptionalStringTemplate(String fieldname)
    • getStaticValueOr

      public <T> T getStaticValueOr(String name, T defaultValue)
      Get the named static field value, or return the provided default, but throw an exception if the named field is dynamic.
      Specified by:
      getStaticValueOr in interface StaticFieldReader
      Type Parameters:
      T - The type of the field to return.
      Parameters:
      name - The name of the field value to return.
      defaultValue - A value to return if the named value is not present in static nor dynamic fields.
      Returns:
      The value
      Throws:
      RuntimeException - if the field name is only present in the dynamic fields.
    • getStaticConfigOr

      public <T> T getStaticConfigOr(String name, T defaultValue)
      Get the specified parameter by the user using the defined field which is closest to the op template. This is the standard way of getting parameter values which can be specified at the op template, op param, or activity level.
      Type Parameters:
      T - The type of the value to return
      Parameters:
      name - The name of the configuration param
      defaultValue - the default value to return if the value is not defined anywhere in (op fields, op params, activity params)
      Returns:
      A configuration value
      Throws:
      NBConfigError - if the named field is defined dynamically, as in this case, it is presumed that the parameter is not supported unless it is defined statically.
    • takeStaticConfigOr

      public <T> T takeStaticConfigOr(String name, T defaultValue)
      Get the parameter value from a static op template field OR any of the provided optional sources of op template values, including the activity parameters
      Type Parameters:
      T - The type of the field
      Parameters:
      name - The config field name
      defaultValue - The default value, if the field is not defined in the op template nor the activity params
      Returns:
      The config value.
    • getStaticConfig

      public String getStaticConfig(String name, Class<String> clazz)
    • getOptionalStaticConfig

      public <T> Optional<T> getOptionalStaticConfig(String name, Class<T> type)
    • getConfigOr

      public <T> T getConfigOr(String name, T defaultValue, long input)
      Works exactly like getStaticConfigOr(String, Object), except that dynamic values at the op field level will be generated on a per-input basis. This is a shortcut method for allowing configuration values to be accessed dynamically where it makes sense.
    • getOptionalStaticValue

      public <T> Optional<T> getOptionalStaticValue(String field, Class<T> classOfT)
      Return an optional value for the named field. This is an Optional form of getStaticValue(java.lang.String, java.lang.Class<T>).
      Specified by:
      getOptionalStaticValue in interface StaticFieldReader
      Type Parameters:
      T - The parameter type of the return
      Parameters:
      field - Name of the field to get
      classOfT - The type of field to return. If the actual type is not compatible to a cast to this type, then a casting error will be thrown.
      Returns:
      An optional value, empty unless the named value is defined in the static field map.
    • takeOptionalStaticValue

      public <T> Optional<T> takeOptionalStaticValue(String field, Class<T> classOfT)
    • get

      public <T> T get(String field, long input)
      Get the named field value for a given long input. This uses parameter type inference -- The casting to the return type will be based on the type of any assignment or casting on the caller's side. Thus, if the actual type is not compatable to a cast to the needed return type, a casting error will be thrown.
      Specified by:
      get in interface DynamicFieldReader
      Type Parameters:
      T - The parameter type of the returned value. Inferred from usage context.
      Parameters:
      field - The name of the field to get.
      input - The seed value, or cycle value for which to generate the value.
      Returns:
      The value.
    • getDefinedNames

      public Set<String> getDefinedNames()
      Returns:
      a set of names which are defined, whether in static fields or dynamic fields
    • getAsRequiredFunction

      public LongFunction<String> getAsRequiredFunction(String name)
      Get the op field as a LongFunction of String. This is a convenience form for getAsRequiredFunction(String, Class)
      Parameters:
      name - The field name which must be defined as static or dynamic
      Returns:
      A function which can provide the named field value
    • getAsOptionalFunction

      public <V> Optional<LongFunction<V>> getAsOptionalFunction(String name, Class<V> type)
      Get the op field as a LongFunction
      Parameters:
      name - The field name which must be defined as static or dynamic
      type - The value type which the field must be assignable to
      Returns:
      A function which can provide a value for the given name and type
    • getAsOptionalEnumFunction

      public <V extends Enum<V>> Optional<LongFunction<V>> getAsOptionalEnumFunction(String name, Class<? extends V> type)
    • getAsOptionalFunction

      public <V> Optional<LongFunction<String>> getAsOptionalFunction(String name)
    • getAsRequiredFunction

      public <V> LongFunction<V> getAsRequiredFunction(String name, Class<? extends V> type)
    • getAsFunctionOr

      public <V> LongFunction<V> getAsFunctionOr(String name, V defaultValue)
      Get a LongFunction which returns either the static value, the dynamic value, or the default value, in that order, depending on where it is found first.
      Specified by:
      getAsFunctionOr in interface DynamicFieldReader
      Type Parameters:
      V - The type of value to return
      Parameters:
      name - The param name for the value
      defaultValue - The default value to provide the value is not defined for static nor dynamic
      Returns:
      A LongFunction of type V
    • getAsCachedFunctionOr

      public <V> LongFunction<V> getAsCachedFunctionOr(String fieldname, String defaultValue, Function<String,V> init)
      Get a LongFunction that first creates a LongFunction of String as in getAsRequiredFunction(String, Class), but then applies the result and caches it for subsequent access. This relies on ObjectCache internally.
      Type Parameters:
      V - The type of object to return
      Parameters:
      fieldname - The name of the field which could contain a static or dynamic value
      defaultValue - The default value to use in the init function if the fieldname is not defined as static nor dynamic
      init - A function to apply to the value to produce the product type
      Returns:
      A caching function which chains to the init function, with caching
    • isDefined

      public boolean isDefined(String field)
      Specified by:
      isDefined in interface StaticFieldReader
      Parameters:
      field - The requested field name
      Returns:
      true if the named field is defined as static or dynamic
    • isUndefined

      public boolean isUndefined(String field)
      Inverse of isDefined(String), provided for clarify in some situations
      Parameters:
      field - The field name
      Returns:
      true if the named field is defined neither as static nor as dynamic
    • isDefined

      public boolean isDefined(String field, Class<?> type)
      Specified by:
      isDefined in interface StaticFieldReader
      Parameters:
      field - The requested field name
      type - The required type of the field value
      Returns:
      true if the named field is defined as static or dynamic and the value produced can be assigned to the specified type
    • isDefinedAll

      public boolean isDefinedAll(String... fields)
      convenience method for conjugating isDefined(String) with AND
      Parameters:
      fields - The fields which should be defined as either static or dynamic
      Returns:
      true if all specified fields are defined as static or dynamic
    • newListBinder

      public LongFunction<List<Object>> newListBinder(String... fields)
      Parameters:
      fields - The ordered field names for which the ListBinder will be created
      Returns:
      a new ListBinder which can produce a List of Objects from a long input.
    • newListBinder

      public LongFunction<List<Object>> newListBinder(List<String> fields)
      Parameters:
      fields - The ordered field names for which the ListBinder will be created
      Returns:
      a new ListBinder which can produce a List of Objects from a long input.
    • newOrderedMapBinder

      public LongFunction<Map<String,Object>> newOrderedMapBinder(String... fields)
      Parameters:
      fields - The ordered field names for which the OrderedMapBinder will be created
      Returns:
      a new OrderedMapBinder which can produce a Map of String to Objects from a long input.
    • newArrayBinder

      public LongFunction<Object[]> newArrayBinder(String... fields)
      Parameters:
      fields - The ordered field names for which the ArrayBinder will be created
      Returns:
      a new ArrayBinder which can produce a Object array from a long input.
    • newArrayBinder

      public LongFunction<Object[]> newArrayBinder(List<String> fields)
      Parameters:
      fields - The ordered field names for which the ArrayBinder will be created
      Returns:
      a new ArrayBinder which can produce a Object array from a long input.
    • newArrayBinderFromBindPoints

      public LongFunction<Object[]> newArrayBinderFromBindPoints(List<BindPoint> bindPoints)
      Parameters:
      bindPoints - The BindPoints for which the ArrayBinder will be created
      Returns:
      a new ArrayBinder which can produce a Object array from a long input.
    • getMapper

      public LongFunction<?> getMapper(String field)
      Get the LongFunction which is used to resolve a dynamic field value.
      Parameters:
      field - The field name for a dynamic parameter
      Returns:
      The mapping function
    • getSize

      public int getSize()
      Returns:
      the logical map size, including all static and dynamic fields
    • getValueType

      public Class<?> getValueType(String fieldname)
    • getTypeAndTargetFromEnum

      public <E extends Enum<E>, V> Optional<TypeAndTarget<E,V>> getTypeAndTargetFromEnum(Class<E> enumclass, Class<V> valueClass)
      Given an enum of any type, return the enum value which is found in any of the field names of the op template, ignoring case and any non-word characters. This is useful for matching op templates to op types where the presence of a field determines the type. Further, if there are multiple matching names, an OpConfigError is thrown to avoid possible ambiguity.
      Type Parameters:
      E - Generic type for the enum class
      Parameters:
      enumclass - The enum class for matching values
      Returns:
      Optionally, an enum value which matches, or Optional.empty()
      Throws:
      OpConfigError - if more than one field matches
    • getOptionalTypeAndTargetEnum

      public <E extends Enum<E>, V> Optional<TypeAndTarget<E,V>> getOptionalTypeAndTargetEnum(Class<E> enumclass, Class<V> valueClass)
    • getOptionalTypeAndTargetEnum

      public <E extends Enum<E>, V> Optional<TypeAndTarget<E,V>> getOptionalTypeAndTargetEnum(Class<E> enumclass, Class<V> valueClass, String alternateTypeField, String alternateValueField)
    • getTypeAndTarget

      public <E extends Enum<E>, V> TypeAndTarget<E,V> getTypeAndTarget(Class<E> enumclass, Class<V> valueClass)
    • getTypeAndTarget

      public <E extends Enum<E>, V> TypeAndTarget<E,V> getTypeAndTarget(Class<E> enumclass, Class<V> valueclass, String tname, String vname)
    • getOptionalEnumFromField

      public <E extends Enum<E>> Optional<E> getOptionalEnumFromField(Class<E> enumclass, String fieldName)
    • getEnumFromFieldOr

      public <E extends Enum<E>> E getEnumFromFieldOr(Class<E> enumClass, E defaultEnum, String fieldName)
    • takeEnumFromFieldOr

      public <E extends Enum<E>> E takeEnumFromFieldOr(Class<E> enumClass, E defaultEnum, String fieldName)
    • enhanceDefaultFunc

      public <FA, FE> LongFunction<FA> enhanceDefaultFunc(LongFunction<FA> func, String field, Class<FE> type, FE defaultFe, BiFunction<FA,FE,FA> combiner)

      Enhance a Function with another required named field or function combiner OR a default value.

      Type Parameters:
      FA - The base function result type
      FE - The enhancer function result type
      Parameters:
      func - The base function
      field - The field name to derive the named enhancer function from
      type - The type of the field value
      defaultFe - The default value of the field, if none is provided
      combiner - A BiFunction which applies the field or function combiner to the base function
      Returns:
      an enhanced function
    • enhanceFunc

      public <FA, FE> LongFunction<FA> enhanceFunc(LongFunction<FA> func, String field, Class<FE> type, BiFunction<FA,FE,FA> combiner)

      Enhance a Function with a named required function, or throw an error.

      Type Parameters:
      FA - The base function result type
      FE - The enhancer function result type
      Parameters:
      func - The base function
      field - The field name to derive the named enhancer function from
      type - The type of the field value
      combiner - A BiFunction which applies the field or function combiner to the base function
      Returns:
      a version of the base function, optionally enhanced
    • enhanceFuncOptionally

      public <FA, FE> LongFunction<FA> enhanceFuncOptionally(LongFunction<FA> func, String field, Class<FE> type, BiFunction<FA,FE,FA> combiner)

      Enhance a Function with a named optional function IFF it exists.

      Type Parameters:
      FA - The base function result type
      FE - The enhancer function result type
      Parameters:
      func - The base function
      field - The field name to derive the named enhancer function from
      type - The type of the field value
      combiner - A BiFunction which applies the field or function combiner to the base function
      Returns:
      a version of the base function, optionally enhanced
    • getRefKey

      public int getRefKey()
    • getAsSubOps

      public Map<String,ParsedOp> getAsSubOps(String fromOpField, ParsedOp.SubOpNaming naming)
    • getAsSubOp

      public ParsedOp getAsSubOp(String name, ParsedOp.SubOpNaming naming)
    • enhanceOptionalFuncOptionally

      public <FA, FE> Optional<LongFunction<FA>> enhanceOptionalFuncOptionally(Optional<LongFunction<FA>> func, String field, Class<FE> type, BiFunction<FA,FE,FA> combiner)

      Enhance an Optional Function with an optional named field or value combiner, IFF both functions are defined.

      Type Parameters:
      FA - The base function result type
      FE - The enhancer function result type
      Parameters:
      func - The base function
      field - The field name to derive the named enhancer function from
      type - The type of the field value
      combiner - A BiFunction which applies the field or function combiner to the base function
      Returns:
      the enhanced optional function
    • enhanceOptionalDefaultFunc

      public <FA, FE> Optional<LongFunction<FA>> enhanceOptionalDefaultFunc(Optional<LongFunction<FA>> func, String field, Class<FE> type, FE defaultFe, BiFunction<FA,FE,FA> combiner)

      Enhance an Optional Function with a named field or function combiner OR a default value, IFF the base function is present.

      Create a required function for the specified field and default value, IFF the main function is present. The base type of the function remains the same, and if present, will be extended with the required field value or function in the provided combiner.

      Type Parameters:
      FA - The base function result type
      FE - The enhancer function result type
      Parameters:
      func - The base function
      field - The field name to derive the named enhancer function from
      type - The type of the field value
      defaultFe - The default value of the field, if none is provided
      combiner - A BiFunction which applies the field or function combiner to the base function
      Returns:
      the enhanced optional base function
    • enhanceEnumOptionally

      public <S extends FA, FA, FE extends Enum<FE>> LongFunction<S> enhanceEnumOptionally(LongFunction<S> func, String field, Class<FE> type, BiFunction<S,FE,S> combiner)

      Enhance a Function with an optional enum function IFF it is defined.

      Type Parameters:
      FA - The base function result type
      FE - The enhancer function result type
      Parameters:
      func - The base function
      field - The field name to derive the named enhancer function from
      type - The type of the field value
      combiner - A BiFunction which applies the field or function combiner to the base function
      Returns:
      an (optionally) enhanced base function
    • parseStaticCmdMap

      public Map<String,Object> parseStaticCmdMap(String key, String mainField)
    • parseStaticCmdMaps

      public List<Map<String,Object>> parseStaticCmdMaps(String key, String mainField)
    • toString

      public String toString()
      Overrides:
      toString in class NBBaseComponent
    • getCaptures

      public CapturePoints getCaptures()
    • getBindPoints

      public Map<String,String> getBindPoints()
    • isDefinedExactly

      public boolean isDefinedExactly(String... fields)
    • enhanceFuncOptionally2

      public <FA, FE, FF> LongFunction<FA> enhanceFuncOptionally2(LongFunction<FA> func, String field, Class<FE> type, String field2, Class<FF> type2, TriFunction<FA,FE,FF> triCombiner)
    • enhanceFuncPivot

      public <FA, FE, FR> LongFunction<FR> enhanceFuncPivot(LongFunction<FA> func, String field, Class<FE> type, BiFunction<FA,FE,FR> combiner)
    • optionalFieldOf

      public Optional<String> optionalFieldOf(List<String> fields)
    • optionalFieldOf

      public Optional<String> optionalFieldOf(String... fields)
    • requiredFieldOf

      public String requiredFieldOf(String... fields)
    • requiredFieldOf

      public String requiredFieldOf(List<String> fields)