Package org.pentaho.di.core.util
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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description KeyValueSet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description KeyValueSetadd(KeyValue<?>... keyValues)Add key value(s).KeyValueSetclear()Clear entries.booleancontainsKey(String key)KeyValue<?>get(String key)List<KeyValue<?>>get(org.apache.commons.collections.Predicate filter)KeyValue<?>getRequired(String key)booleanisEmpty()Iterator<KeyValue<?>>iterator()List<String>keys()List<KeyValue<?>>keyValues()KeyValue<?>remove(String key)intsize()Map<String,Object>toMap()StringtoMultiLineString()StringtoString()List<Object>values()voidwalk(org.apache.commons.collections.Closure handler)Walk entries.voidwalk(org.apache.commons.collections.Closure handler, org.apache.commons.collections.Predicate filter)Walk entries.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
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:
iteratorin interfaceIterable<KeyValue<?>>- See Also:
Iterable.iterator()
-
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.
-
walk
public void walk(org.apache.commons.collections.Closure handler, org.apache.commons.collections.Predicate filter) throws IllegalArgumentExceptionWalk 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 IllegalArgumentExceptionWalk entries.- Parameters:
handler- handler to call.- Throws:
IllegalArgumentException- if handler is 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:
toStringin classObject- See Also:
Object.toString()
-
-