Package org.apache.hop.core.util
Class StringListPluginProperty
- java.lang.Object
-
- org.apache.hop.core.util.KeyValue<List<String>>
-
- org.apache.hop.core.util.StringListPluginProperty
-
- All Implemented Interfaces:
Serializable,Iterable<String>,IPluginProperty
public class StringListPluginProperty extends KeyValue<List<String>> implements IPluginProperty, Iterable<String>
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static charSEPARATOR_CHARThe separator character.static StringVALUE_XML_TAG_NAMEValue XML tag name.-
Fields inherited from class org.apache.hop.core.util.KeyValue
DEFAULT_TRUE_VALUES, VALID_KEY_CHARS
-
Fields inherited from interface org.apache.hop.core.util.IPluginProperty
BOOLEAN_STRING_TRUE, DEFAULT_BOOLEAN_VALUE, DEFAULT_DOUBLE_VALUE, DEFAULT_INTEGER_VALUE, DEFAULT_STRING_VALUE
-
-
Constructor Summary
Constructors Constructor Description StringListPluginProperty(String key)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappendXml(StringBuilder builder)voidassertValueNotNull()Assert state, value not null.static StringasString(List<String> list)booleanevaluate()static List<String>fromString(String input)booleanisEmpty()Iterator<String>iterator()voidloadXml(Node node)voidreadFromPreferences(Preferences node)voidsaveToPreferences(Preferences node)voidsetValues(String... values)intsize()-
Methods inherited from class org.apache.hop.core.util.KeyValue
assertKey, booleanValue, booleanValue, booleanValue, booleanValue, booleanValue, doubleValue, doubleValue, floatValue, floatValue, getKey, getValue, integerValue, integerValue, longValue, longValue, setValue, stringValue, stringValue, stringValueDefaultIfBlank, toString, value, value
-
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
-
-
-
-
Field Detail
-
VALUE_XML_TAG_NAME
public static final String VALUE_XML_TAG_NAME
Value XML tag name.- See Also:
- Constant Field Values
-
SEPARATOR_CHAR
public static final char SEPARATOR_CHAR
The separator character.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
StringListPluginProperty
public StringListPluginProperty(String key)
- Parameters:
key- key to use.
-
-
Method Detail
-
asString
public static String asString(List<String> list)
- Parameters:
list- list to transform, maybe null.- Returns:
- string, never null.
-
fromString
public static List<String> fromString(String input)
- Parameters:
input- the input.- Returns:
- new list, never null.
-
appendXml
public void appendXml(StringBuilder builder)
- Specified by:
appendXmlin interfaceIPluginProperty- Parameters:
builder- builder to append to.
-
evaluate
public boolean evaluate()
- Specified by:
evaluatein interfaceIPluginProperty- Returns:
- true if value not null or 'false'.
-
loadXml
public void loadXml(Node node)
- Specified by:
loadXmlin interfaceIPluginProperty- Parameters:
node- the node.
-
readFromPreferences
public void readFromPreferences(Preferences node)
- Specified by:
readFromPreferencesin interfaceIPluginProperty- Parameters:
node- preferences node.
-
saveToPreferences
public void saveToPreferences(Preferences node)
- Specified by:
saveToPreferencesin interfaceIPluginProperty- Parameters:
node- preferences node
-
setValues
public void setValues(String... values)
- Parameters:
values- values to set, no validation.
-
iterator
public Iterator<String> iterator() throws IllegalStateException
- Specified by:
iteratorin interfaceIterable<String>- Throws:
IllegalStateException- See Also:
Iterable.iterator()
-
isEmpty
public boolean isEmpty()
- Returns:
- true if list is empty .
-
size
public int size() throws IllegalStateException- Returns:
- size
- Throws:
IllegalStateException- if value is null.
-
assertValueNotNull
public void assertValueNotNull() throws IllegalStateExceptionAssert state, value not null.- Throws:
IllegalStateException- if this.value is null.
-
-