Class MapBackedElement

java.lang.Object
io.nosqlbench.nb.api.config.params.MapBackedElement
All Implemented Interfaces:
ElementData

public class MapBackedElement extends Object implements ElementData
  • Constructor Details

    • MapBackedElement

      public MapBackedElement(String elementName, Map<String,?> map)
  • Method Details

    • get

      public Object get(String name)
      Specified by:
      get in interface ElementData
    • getKeys

      public Set<String> getKeys()
      Specified by:
      getKeys in interface ElementData
    • containsKey

      public boolean containsKey(String name)
      Specified by:
      containsKey in interface ElementData
    • getGivenName

      public String getGivenName()
      Specified by:
      getGivenName in interface ElementData
    • getAsCommon

      public Object getAsCommon(String key)
      Description copied from interface: ElementData

      Get the value for the key, but ensure that the type of value that is returned is in one of the sanctioned ElementData.COMMON_TYPES.

      If possible, the value provided should be a wrapper type around the actual backing type, such that mutability is preserved.

      If the backing type is a structured type object graph which defies direct conversion to one of the types above, then an error should be thrown.

      If the type is a collection type, then type conversion should be provided all the way down to each primitive value.

      If no value by the given name exists, the null should be returned.

      Specified by:
      getAsCommon in interface ElementData
      Parameters:
      key - The key of the value to retrieve
      Returns:
      The value as a Java primitive, Boxed primitive, or Set, List, or Map of String to Object.
    • toString

      public String toString()
      Overrides:
      toString in class Object