Class KeyValueSet

java.lang.Object
org.pentaho.di.core.util.KeyValueSet
All Implemented Interfaces:
Serializable, Iterable<KeyValue<?>>

public class KeyValueSet extends Object implements Iterable<KeyValue<?>>, Serializable
Author:
Thomas Hoedl(asc042)
See Also:
  • Constructor Details

    • KeyValueSet

      public KeyValueSet()
  • Method Details

    • add

      public KeyValueSet add(KeyValue<?>... keyValues)
      Add key value(s).
      Parameters:
      keyValues - key values to add.
      Returns:
      this.
    • iterator

      public Iterator<KeyValue<?>> iterator()
      Specified by:
      iterator in interface Iterable<KeyValue<?>>
      See Also:
    • get

      public KeyValue<?> get(String key)
      Parameters:
      key - the key.
      Returns:
      key value or null.
    • get

      public List<KeyValue<?>> get(org.apache.commons.collections.Predicate filter) throws IllegalArgumentException
      Parameters:
      filter - filter to use.
      Returns:
      matching key values.
      Throws:
      IllegalArgumentException - if filter is null.
    • getRequired

      public KeyValue<?> getRequired(String key)
      Parameters:
      key - the key.
      Returns:
      key value, never null.
    • keys

      public List<String> keys()
      Returns:
      keys.
    • keyValues

      public List<KeyValue<?>> keyValues()
      Returns:
      key values/entries.
    • values

      public List<Object> values()
      Returns:
      values.
    • toMap

      public Map<String,Object> toMap()
      Returns:
      entries as map.
    • walk

      public void walk(org.apache.commons.collections.Closure handler, org.apache.commons.collections.Predicate filter) throws IllegalArgumentException
      Walk entries.
      Parameters:
      handler - handler to call.
      filter - filter to use.
      Throws:
      IllegalArgumentException - if closure or filter is null.
    • walk

      public void walk(org.apache.commons.collections.Closure handler) throws IllegalArgumentException
      Walk entries.
      Parameters:
      handler - handler to call.
      Throws:
      IllegalArgumentException - if handler is null.
    • remove

      public KeyValue<?> remove(String key)
      Parameters:
      key - the key.
      Returns:
      previous or null.
    • containsKey

      public boolean containsKey(String key)
      Parameters:
      key - key to test.
      Returns:
      true if ...
    • size

      public int size()
      Returns:
      size.
    • isEmpty

      public boolean isEmpty()
      Returns:
      true if empty.
    • clear

      public KeyValueSet clear()
      Clear entries.
      Returns:
      this.
    • toMultiLineString

      public String toMultiLineString()
      Returns:
      string representation.
    • toString

      public String toString()
      Overrides:
      toString in class Object
      See Also: