Package org.cyclos.utils
Interface ParameterStorage
-
- All Known Subinterfaces:
ObjectParameterStorage,ScriptObjectStorage
- All Known Implementing Classes:
AbstractParameterStorage,CustomWizardExecutionStorage,EntityBackedParameterStorage,JacksonParameterStorage,MapParameterStorage
public interface ParameterStorageA parameter storage can hold parameters as simple values. Implementations supply a propertyMissing method, so when used in Groovy scripts, it is possible to get / set string parameters with a syntax like parameterStorage.name = "value".
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default ParameterStorageaddBoolean(String name, boolean value)Sets the parameter with the given name as a boolean value and returns thisdefault ParameterStorageaddDate(String name, Date value)Sets a parameter as date and returns thisdefault ParameterStorageaddDecimal(String name, BigDecimal... values)Sets the parameter with the given name as a decimal or a list of decimals and returns thisdefault ParameterStorageaddEnum(String name, Enum<?>... values)Sets the parameter with the given name as an enum or a list of enums and returns thisdefault ParameterStorageaddInteger(String name, Integer... values)Sets the parameter with the given name as a integer or a list of integer and returns thisdefault ParameterStorageaddLong(String name, Long... values)Sets the parameter with the given name as a long or a list of long and returns thisdefault ParameterStorageaddString(String name, String... values)Sets the parameter with the given name as a string or a list of strings and returns thisbooleangetBoolean(String name)Returns a parameter as a boolean valueDategetDate(String name)Returns a parameter as dateBigDecimalgetDecimal(String name)Returns a parameter as a decimal value, or null if the parameter is not setList<BigDecimal>getDecimalList(String name)Returns a parameter as a decimal list, or null if the parameter is not set<T extends Enum<T>>
TgetEnum(String name, Class<T> enumType)Returns a parameter as an enumerated value, with the given class, or null if the parameter is not set<T extends Enum<T>>
List<T>getEnumList(String name, Class<T> enumType)Returns a parameter as a list of enumerated values, with the given class, or null if the parameter is not setIntegergetInteger(String name)Returns a parameter as a integer, or null if the parameter is not setList<Integer>getIntegerList(String name)Returns a parameter as a list of integers, or null if the parameter is not setLonggetLong(String name)Returns a parameter as a long, or null if the parameter is not setList<Long>getLongList(String name)Returns a parameter as a list of longs, or null if the parameter is not setIterator<String>getNames()Returns the names of all parameters with valuesStringgetString(String name)Returns the parameter as a string, or null if the parameter is not setList<String>getStringList(String name)Returns the parameter as a list of strings, or null if the parameter is not setbooleanisSet(String name)Returns whether the given parameter is setvoidremove(String name)Removes the parameter with the given namevoidsetBoolean(String name, boolean value)Sets the parameter with the given name as a boolean valuevoidsetDate(String name, Date value)Sets a parameter as datevoidsetDecimal(String name, BigDecimal... values)Sets the parameter with the given name as a decimal or a list of decimalsvoidsetEnum(String name, Enum<?>... values)Sets the parameter with the given name as an enum or a list of enumsvoidsetInteger(String name, Integer... values)Sets the parameter with the given name as a integer or a list of integervoidsetLong(String name, Long... values)Sets the parameter with the given name as a long or a list of longvoidsetString(String name, String... values)Sets the parameter with the given name as a string or a list of strings
-
-
-
Method Detail
-
addBoolean
default ParameterStorage addBoolean(String name, boolean value)
Sets the parameter with the given name as a boolean value and returns this
-
addDate
default ParameterStorage addDate(String name, Date value)
Sets a parameter as date and returns this
-
addDecimal
default ParameterStorage addDecimal(String name, BigDecimal... values)
Sets the parameter with the given name as a decimal or a list of decimals and returns this
-
addEnum
default ParameterStorage addEnum(String name, Enum<?>... values)
Sets the parameter with the given name as an enum or a list of enums and returns this
-
addInteger
default ParameterStorage addInteger(String name, Integer... values)
Sets the parameter with the given name as a integer or a list of integer and returns this
-
addLong
default ParameterStorage addLong(String name, Long... values)
Sets the parameter with the given name as a long or a list of long and returns this
-
addString
default ParameterStorage addString(String name, String... values)
Sets the parameter with the given name as a string or a list of strings and returns this
-
getBoolean
boolean getBoolean(String name)
Returns a parameter as a boolean value
-
getDecimal
BigDecimal getDecimal(String name)
Returns a parameter as a decimal value, or null if the parameter is not set
-
getDecimalList
List<BigDecimal> getDecimalList(String name)
Returns a parameter as a decimal list, or null if the parameter is not set
-
getEnum
<T extends Enum<T>> T getEnum(String name, Class<T> enumType)
Returns a parameter as an enumerated value, with the given class, or null if the parameter is not set
-
getEnumList
<T extends Enum<T>> List<T> getEnumList(String name, Class<T> enumType)
Returns a parameter as a list of enumerated values, with the given class, or null if the parameter is not set
-
getInteger
Integer getInteger(String name)
Returns a parameter as a integer, or null if the parameter is not set
-
getIntegerList
List<Integer> getIntegerList(String name)
Returns a parameter as a list of integers, or null if the parameter is not set
-
getLong
Long getLong(String name)
Returns a parameter as a long, or null if the parameter is not set
-
getLongList
List<Long> getLongList(String name)
Returns a parameter as a list of longs, or null if the parameter is not set
-
getString
String getString(String name)
Returns the parameter as a string, or null if the parameter is not set
-
getStringList
List<String> getStringList(String name)
Returns the parameter as a list of strings, or null if the parameter is not set
-
isSet
boolean isSet(String name)
Returns whether the given parameter is set
-
remove
void remove(String name)
Removes the parameter with the given name
-
setBoolean
void setBoolean(String name, boolean value)
Sets the parameter with the given name as a boolean value
-
setDecimal
void setDecimal(String name, BigDecimal... values)
Sets the parameter with the given name as a decimal or a list of decimals
-
setEnum
void setEnum(String name, Enum<?>... values)
Sets the parameter with the given name as an enum or a list of enums
-
setInteger
void setInteger(String name, Integer... values)
Sets the parameter with the given name as a integer or a list of integer
-
setLong
void setLong(String name, Long... values)
Sets the parameter with the given name as a long or a list of long
-
-