Package org.pentaho.di.core.util
Class KeyValue<T>
java.lang.Object
org.pentaho.di.core.util.KeyValue<T>
- Type Parameters:
T
- type of value
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
BooleanPluginProperty
,IntegerPluginProperty
,StringListPluginProperty
,StringPluginProperty
- Author:
- Thomas Hoedl(asc042)
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionThe default true values.static final String
Valid key characters. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic final void
Uses DEFAULT_TRUE_VALUES, ignore case.booleanValue
(Boolean defaultValue) booleanValue
(String... trueValues) booleanValue
(List<String> trueValues) booleanValue
(List<String> trueValues, boolean ignoreCase) doubleValue
(Double defaultValue) floatValue
(Float defaultValue) getKey()
getValue()
integerValue
(Integer defaultValue) void
stringValue
(String defaultValue) stringValueDefaultIfBlank
(String defaultValue) toString()
value()
-
Field Details
-
DEFAULT_TRUE_VALUES
The default true values. -
VALID_KEY_CHARS
Valid key characters.- See Also:
-
-
Constructor Details
-
KeyValue
Constructor. Key will be converted to lower case.- Parameters:
key
- key to set.value
- value to set, may be null.- Throws:
IllegalArgumentException
- if key is invalid.
-
KeyValue
Constructor. Key will be converted to lower case. Value is null.- Parameters:
key
- key to set.- Throws:
IllegalArgumentException
- if key is invalid.
-
-
Method Details
-
assertKey
- Parameters:
lowerKey
- key to test.- Throws:
IllegalArgumentException
- if key is invalid.
-
getKey
- Returns:
- the key, never null.
-
getValue
- Returns:
- the value
-
setValue
- Parameters:
value
- the value to set
-
value
- Parameters:
newValue
- value to set.- Returns:
- this.
-
value
- Returns:
- value.
-
booleanValue
- Parameters:
trueValues
- string true values, case is ignored.- Returns:
- boolean value, null if value is null.
-
booleanValue
- Parameters:
trueValues
- string true values, case is ignored.- Returns:
- boolean value, null if value is null.
-
booleanValue
- Parameters:
trueValues
- string true values.ignoreCase
- ignore case?- Returns:
- boolean value, null if value is null.
-
booleanValue
Uses DEFAULT_TRUE_VALUES, ignore case.- Returns:
- boolean value or null if value is null.
-
booleanValue
- Parameters:
defaultValue
- the default value- Returns:
- boolean value or default value if value is null.
-
stringValue
- Returns:
- string value or null if value is null.
-
stringValue
- Parameters:
defaultValue
- the default value.- Returns:
- string value or default value if value is null.
-
stringValueDefaultIfBlank
- Parameters:
defaultValue
- the default value.- Returns:
- string value or default value if value is blank.
-
integerValue
- Returns:
- integer value or null if value is null.
- Throws:
NumberFormatException
- if string value of value cannot be converted to Integer
-
integerValue
- Parameters:
defaultValue
- the default value.- Returns:
- integer value or default value if value is null or cannot be converted to integer.
-
longValue
- Returns:
- long value or null if value is null.
- Throws:
NumberFormatException
- if string value of value cannot be converted to Long
-
longValue
- Parameters:
defaultValue
- the default value.- Returns:
- long value or default value if value is null or cannot be converted to long.
-
doubleValue
- Returns:
- double value or null if value is null.
- Throws:
NumberFormatException
- if string value of value cannot be converted to Double
-
doubleValue
- Parameters:
defaultValue
- the default value.- Returns:
- double value or default value if value is null or cannot be converted to double.
-
floatValue
- Returns:
- float value or null if value is null.
- Throws:
NumberFormatException
- if string value of value cannot be converted to Float
-
floatValue
- Parameters:
defaultValue
- the default value.- Returns:
- float value or default value if value is null or cannot be converted to float.
-
toString
-