Package overit.geocall.util
Class SerialGetter
- Direct Known Subclasses:
PropertyGetter,StringGetter
This class extends
Properties implements the Getter interface and is used to store
and easily retrieves objects.- See Also:
-
Field Summary
Fields inherited from class java.util.Properties
defaults -
Constructor Summary
ConstructorsConstructorDescriptionCreates an empty SerialGetterSerialGetter(boolean ignoreCase) Creates a new empty SerialGetter, key sensitive or not depending on the value of the parameter -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsKey(String key) Checks if the specified key is within this SerialGetter.Returns the Object that corresponds to the key passed as parameters.Returns the Object that corresponds to the key passed as parameters.booleangetboolean(String key, boolean def) Returns the boolean value that corresponds to the key passed as parameter.getBoolean(String key, Boolean def) Returns the Boolean value that corresponds to the key passed as parameter.getDate(String key, Date def, SimpleDateFormat sdf) Returns the Date value, formatted using the SimpleDateFormat passed as parameter, that corresponds to the key.doubleReturns the double value that corresponds to the key passed as parameter.Returns the Double value that corresponds to the key passed as parameter.floatReturns the float value that corresponds to the key passed as parameter.Returns the Float value that corresponds to the key passed as parameter.intReturns the int value that corresponds to the key passed as parameter.getInteger(String key, Integer def) Returns the Integer value that corresponds to the key passed as parameter.longReturns the long value that corresponds to the key passed as parameter.Returns the Long value that corresponds to the key passed as parameter.Returns the String value that corresponds to the key.Returns the Iterator used to iterate over all the entriesMaps the specified key to the specified value in this SerialGetter.voidMethods inherited from class java.util.Properties
clear, clone, compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, forEach, get, getOrDefault, getProperty, getProperty, hashCode, isEmpty, keys, keySet, list, list, load, load, loadFromXML, merge, propertyNames, putIfAbsent, rehash, remove, remove, replace, replace, replaceAll, save, setProperty, size, store, store, storeToXML, storeToXML, storeToXML, stringPropertyNames, toString, values
-
Constructor Details
-
SerialGetter
public SerialGetter()Creates an empty SerialGetter -
SerialGetter
public SerialGetter(boolean ignoreCase) Creates a new empty SerialGetter, key sensitive or not depending on the value of the parameter- Parameters:
ignoreCase-falseto create a key sensitive SerialGetter,trueotherwise
-
-
Method Details
-
getBoolean
Returns the Boolean value that corresponds to the key passed as parameter. The search mode will not be key sensitive if this has been requested by the constructorSerialGetter(boolean)- Specified by:
getBooleanin interfaceGetter- Parameters:
key- The name of the keydef- The default value returned if the key is not present in the SerialGetter or if the string value cannot be transformed into a Boolean- Returns:
Boolean.TRUEif the value is "true" or "1",Boolean.FALSEif the value is "false" or "0", the default Boolean value otherwise
-
getboolean
Returns the boolean value that corresponds to the key passed as parameter. The search mode will not be key sensitive if this has been requested by the constructorSerialGetter(boolean)- Specified by:
getbooleanin interfaceGetter- Parameters:
key- The name of the keydef- The default value returned if the key is not present in the SerialGetter or if the string value cannot be transformed into a boolean- Returns:
trueif the value is "true" or "1",falseif the value is "false" or "0", the default boolean value otherwise
-
getLong
Returns the Long value that corresponds to the key passed as parameter. The search mode will not be key sensitive if this has been requested by the constructorSerialGetter(boolean) -
getlong
Returns the long value that corresponds to the key passed as parameter. The search mode will not be key sensitive if this has been requested by the constructorSerialGetter(boolean) -
getInteger
Returns the Integer value that corresponds to the key passed as parameter. The search mode will not be key sensitive if this has been requested by the constructorSerialGetter(boolean)- Specified by:
getIntegerin interfaceGetter- Parameters:
key- The name of the keydef- The default value returned if the key is not present in the SerialGetter or if the string value cannot be transformed into an Integer- Returns:
- The Integer value that corresponds to the key, or the default one
-
getint
Returns the int value that corresponds to the key passed as parameter. The search mode will not be key sensitive if this has been requested by the constructorSerialGetter(boolean) -
getFloat
Returns the Float value that corresponds to the key passed as parameter. The search mode will not be key sensitive if this has been requested by the constructorSerialGetter(boolean) -
getfloat
Returns the float value that corresponds to the key passed as parameter. The search mode will not be key sensitive if this has been requested by the constructorSerialGetter(boolean) -
getDouble
Returns the Double value that corresponds to the key passed as parameter. The search mode will not be key sensitive if this has been requested by the constructorSerialGetter(boolean) -
getdouble
Returns the double value that corresponds to the key passed as parameter. The search mode will not be key sensitive if this has been requested by the constructorSerialGetter(boolean) -
getDate
Returns the Date value, formatted using the SimpleDateFormat passed as parameter, that corresponds to the key. The search mode will not be key sensitive if this has been requested by the constructorSerialGetter(boolean)- Specified by:
getDatein interfaceGetter- Parameters:
key- The name of the keydef- The default value returned if the key is not present in the SerialGetter or if the string value cannot be transformed into a Datesdf- Teh SimpleDateFormat used to parse the date- Returns:
- The Date value that corresponds to the key, or the default one
-
getString
Returns the String value that corresponds to the key. The search mode will not be key sensitive if this has been requested by the constructorSerialGetter(boolean) -
keyIterator
Returns the Iterator used to iterate over all the entries- Specified by:
keyIteratorin interfaceGetter- Returns:
- The iterator on the entries of the SerialGetter
-
get
Returns the Object that corresponds to the key passed as parameters. In this case there isn't a default value.
The search mode will not be key sensitive if this has been requested by the constructorSerialGetter(boolean) -
get
Returns the Object that corresponds to the key passed as parameters. The search mode will not be key sensitive if this has been requested by the constructorSerialGetter(boolean) -
containsKey
Checks if the specified key is within this SerialGetter. The search mode will not be key sensitive if this has been requested by the constructorSerialGetter(boolean)- Specified by:
containsKeyin interfaceGetter- Parameters:
key- The key checked- Returns:
trueif the key is present,falseotherwise
-
put
Maps the specified key to the specified value in this SerialGetter. -
putAll
-