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 KeyValueSet
add(KeyValue<?>... keyValues)
Add key value(s).KeyValueSet
clear()
Clear entries.boolean
containsKey(String key)
KeyValue<?>
get(String key)
List<KeyValue<?>>
get(org.apache.commons.collections.Predicate filter)
KeyValue<?>
getRequired(String key)
boolean
isEmpty()
Iterator<KeyValue<?>>
iterator()
List<String>
keys()
List<KeyValue<?>>
keyValues()
KeyValue<?>
remove(String key)
int
size()
Map<String,Object>
toMap()
String
toMultiLineString()
String
toString()
List<Object>
values()
void
walk(org.apache.commons.collections.Closure handler)
Walk entries.void
walk(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:
iterator
in 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 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.
-
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 classObject
- See Also:
Object.toString()
-
-