Package org.cyclos.utils
Class AbstractParameterStorage
- java.lang.Object
-
- org.cyclos.utils.AbstractParameterStorage
-
- All Implemented Interfaces:
ParameterStorage
- Direct Known Subclasses:
JacksonParameterStorage,MapParameterStorage
public abstract class AbstractParameterStorage extends Object implements ParameterStorage
Base implementation forParameterStorage, based on the storage as string
-
-
Constructor Summary
Constructors Constructor Description AbstractParameterStorage()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voiddoSet(String name, List<String> values)Must be implemented to actually set the underlying value as a list of stringsbooleangetBoolean(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> enumClass)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> enumClass)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 setbooleanisSet(String name)Returns whether the given parameter is setvoidsetBoolean(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 stringsStringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.cyclos.utils.ParameterStorage
addBoolean, addDate, addDecimal, addEnum, addInteger, addLong, addString, getNames, getString, getStringList, remove
-
-
-
-
Method Detail
-
getBoolean
public final boolean getBoolean(String name)
Description copied from interface:ParameterStorageReturns a parameter as a boolean value- Specified by:
getBooleanin interfaceParameterStorage
-
getDate
public final Date getDate(String name)
Description copied from interface:ParameterStorageReturns a parameter as date- Specified by:
getDatein interfaceParameterStorage
-
getDecimal
public final BigDecimal getDecimal(String name)
Description copied from interface:ParameterStorageReturns a parameter as a decimal value, or null if the parameter is not set- Specified by:
getDecimalin interfaceParameterStorage
-
getDecimalList
public final List<BigDecimal> getDecimalList(String name)
Description copied from interface:ParameterStorageReturns a parameter as a decimal list, or null if the parameter is not set- Specified by:
getDecimalListin interfaceParameterStorage
-
getEnum
public final <T extends Enum<T>> T getEnum(String name, Class<T> enumClass)
Description copied from interface:ParameterStorageReturns a parameter as an enumerated value, with the given class, or null if the parameter is not set- Specified by:
getEnumin interfaceParameterStorage
-
getEnumList
public final <T extends Enum<T>> List<T> getEnumList(String name, Class<T> enumClass)
Description copied from interface:ParameterStorageReturns a parameter as a list of enumerated values, with the given class, or null if the parameter is not set- Specified by:
getEnumListin interfaceParameterStorage
-
getInteger
public final Integer getInteger(String name)
Description copied from interface:ParameterStorageReturns a parameter as a integer, or null if the parameter is not set- Specified by:
getIntegerin interfaceParameterStorage
-
getIntegerList
public final List<Integer> getIntegerList(String name)
Description copied from interface:ParameterStorageReturns a parameter as a list of integers, or null if the parameter is not set- Specified by:
getIntegerListin interfaceParameterStorage
-
getLong
public final Long getLong(String name)
Description copied from interface:ParameterStorageReturns a parameter as a long, or null if the parameter is not set- Specified by:
getLongin interfaceParameterStorage
-
getLongList
public final List<Long> getLongList(String name)
Description copied from interface:ParameterStorageReturns a parameter as a list of longs, or null if the parameter is not set- Specified by:
getLongListin interfaceParameterStorage
-
isSet
public final boolean isSet(String name)
Description copied from interface:ParameterStorageReturns whether the given parameter is set- Specified by:
isSetin interfaceParameterStorage
-
setBoolean
public final void setBoolean(String name, boolean value)
Description copied from interface:ParameterStorageSets the parameter with the given name as a boolean value- Specified by:
setBooleanin interfaceParameterStorage
-
setDate
public final void setDate(String name, Date value)
Description copied from interface:ParameterStorageSets a parameter as date- Specified by:
setDatein interfaceParameterStorage
-
setDecimal
public final void setDecimal(String name, BigDecimal... values)
Description copied from interface:ParameterStorageSets the parameter with the given name as a decimal or a list of decimals- Specified by:
setDecimalin interfaceParameterStorage
-
setEnum
public final void setEnum(String name, Enum<?>... values)
Description copied from interface:ParameterStorageSets the parameter with the given name as an enum or a list of enums- Specified by:
setEnumin interfaceParameterStorage
-
setInteger
public final void setInteger(String name, Integer... values)
Description copied from interface:ParameterStorageSets the parameter with the given name as a integer or a list of integer- Specified by:
setIntegerin interfaceParameterStorage
-
setLong
public final void setLong(String name, Long... values)
Description copied from interface:ParameterStorageSets the parameter with the given name as a long or a list of long- Specified by:
setLongin interfaceParameterStorage
-
setString
public final void setString(String name, String... values)
Description copied from interface:ParameterStorageSets the parameter with the given name as a string or a list of strings- Specified by:
setStringin interfaceParameterStorage
-
-