Class Param<T>

java.lang.Object
io.nosqlbench.nb.api.config.standard.Param<T>
Type Parameters:
T - The type of value which can be stored in this named configuration parameter in in actual configuration data.

public class Param<T> extends Object
A configuration element describes a single configurable parameter.
  • Field Details

    • type

      public final Class<? extends T> type
    • required

      public boolean required
  • Constructor Details

  • Method Details

    • optional

      public static Param<String> optional(String name)
      Declare an optional String parameter with the given name.
      Parameters:
      name - the name of the parameter
    • optional

      public static Param<String> optional(List<String> names)
      Declare an optional String parameter specified by any of the names. They act as synonyms. When users provide more than one of these in configuration data, it is considered an error.
      Parameters:
      names - one or more names that the parameter can be specified with.
    • optional

      public static <V> Param<V> optional(List<String> names, Class<V> type)
      Declare an optional parameter specified by any of the names which must be assignable to (returnable as) the specified type. When users provide more than one of these in configuration data, it is considered an error.
      Type Parameters:
      V - Generic type for inference.
      Parameters:
      names - one or more names that the parameter can be specified with.
      type - The type of value that the provided configuration value must be returnable as (assignable to)
    • optional

      public static <V> Param<V> optional(List<String> names, Class<V> type, String description)
      Declare an optional parameter specified by any of the names which must be assignable to (returnable as) the specified type. When users provide more than one of these in configuration data, it is considered an error.
      Type Parameters:
      V - Generic type for inference.
      Parameters:
      names - one or more names that the parameter can be specified with.
      type - The type of value that the provided configuration value must be returnable as (assignable to)
      description - A description of what this parameter is
    • optional

      public static <V> Param<V> optional(String name, Class<V> type)
      Declare an optional parameter for the given name which must be assignable to (returnable as) the specified type. When users provide more than one of these in configuration data, it is considered an error.
      Type Parameters:
      V - Generic type for inference.
      Parameters:
      name - the name of the parameter
      type - The type of value that the provided configuration value must be returnable as (assignable to)
    • optional

      public static <V> Param<V> optional(String name, Class<V> type, String description)
      Declare an optional parameter for the given name which must be assignable to (returnable as) the specified type. When users provide more than one of these in configuration data, it is considered an error.
      Type Parameters:
      V - Generic type for inference.
      Parameters:
      name - the name of the parameter
      type - The type of value that the provided configuration value must be returnable as (assignable to)
      description - A description of what this parameter is
    • defaultTo

      public static <V> Param<V> defaultTo(String name, V defaultValue)
      Parameters which are given a default value are automatically marked as required, as the default value allows them to be accessed as such.
      Type Parameters:
      V -
      Parameters:
      name -
      defaultValue -
      Returns:
    • defaultTo

      public static <V> Param<V> defaultTo(String name, V defaultValue, String description)
      Parameters which are given a default value are automatically marked as required, as the default value allows them to be accessed as such.
      Type Parameters:
      V -
      Parameters:
      name -
      defaultValue -
      Returns:
    • defaultTo

      public static <V> Param<V> defaultTo(List<String> names, V defaultValue)
      Parameters which are given a default value are automatically marked as required, as the default value allows them to be accessed as such.
      Type Parameters:
      V -
      Parameters:
      names -
      defaultValue -
      Returns:
    • required

      public static <V> Param<V> required(String name, Class<V> type)
    • required

      public static <V> Param<V> required(List<String> names, Class<V> type)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getNames

      public List<String> getNames()
    • getType

      public Class<?> getType()
    • getDescription

      public String getDescription()
    • isRequired

      public boolean isRequired()
    • setRequired

      public Param<?> setRequired(boolean required)
    • getDefaultValue

      public T getDefaultValue()
    • setDescription

      public Param<T> setDescription(String description)
    • setRegex

      public Param<T> setRegex(Pattern regex)
    • setRegex

      public Param<T> setRegex(String pattern)
    • getRegex

      public Pattern getRegex()
    • addLayer

      public Param<T> addLayer(String layer)
    • getLayers

      public List<String> getLayers()
    • hasLayers

      public boolean hasLayers()
    • containsLayer

      public boolean containsLayer(String layer)
    • validate

      public Param.CheckResult<T> validate(Object value)
    • getExpander

      public NBConfigModelExpander getExpander()
    • expand

      public Param<T> expand(NBConfigModelExpander expander)