Package overit.geocall.util
Class StringGetter
java.lang.Object
java.util.Dictionary<Object,Object>
java.util.Hashtable<Object,Object>
java.util.Properties
overit.geocall.util.SerialGetter
overit.geocall.util.StringGetter
- Direct Known Subclasses:
CxfMode
This class extends
SerialGetter and implements the Getter
interface and is used to easily store strings associations that in this way
becomes easy to extract.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringstatic final StringThe default string used to make the association key,value that determines an entry of the StringGetterstatic final StringThe default string used to separate each entry of the StringGetter from the othersprotected Stringprotected booleanFields inherited from class java.util.Properties
defaults -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new empty StringGetterStringGetter(boolean ignoreCase) Creates a new empty StringGetter, key sensitive or not depending on the value of the parameterStringGetter(boolean ignoreCase, boolean trimParts) Creates a new empty StringGetterCreates a StringGetter and fills it with the values defined by the string passed as parameterStringGetter(String... values) Creates a StringGetter and fills it with the values defined by the string's array passed as parameterStringGetter(String s, boolean ignoreCase) Creates a StringGetter and fills it with the values defined by the string passed as parameterStringGetter(String delim, String assign) Creates a new empty StringGetterStringGetter(String delim, String assign, boolean ignoreCase) Creates a new empty StringGetterStringGetter(String values, String delim, String assign) Creates a StringGetter and fills it with the values defined by the string passed as parameter -
Method Summary
Modifier and TypeMethodDescriptionReturns the string used to make the association key,value that determines an entry of the StringGetterReturns the string used to separate each entry of the StringGetter from the othersReturns the string value associated to the key, or the default one passed as parameter if there isn't an entry with the specified keyvoidSets the values of the StringGetter.voidSets the values of the StringGetter.toString()Returns the string representation of the StringGetterMethods inherited from class overit.geocall.util.SerialGetter
containsKey, get, get, getboolean, getBoolean, getDate, getdouble, getDouble, getfloat, getFloat, getint, getInteger, getlong, getLong, keyIterator, put, putAllMethods 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, values
-
Field Details
-
DEFAULT_DELIMITER
The default string used to separate each entry of the StringGetter from the others- See Also:
-
DEFAULT_ASSIGNER
The default string used to make the association key,value that determines an entry of the StringGetter- See Also:
-
delimiter
-
assigner
-
trimParts
protected boolean trimParts
-
-
Constructor Details
-
StringGetter
public StringGetter()Creates a new empty StringGetter -
StringGetter
public StringGetter(boolean ignoreCase) Creates a new empty StringGetter, key sensitive or not depending on the value of the parameter- Parameters:
ignoreCase-falseto create a key sensitive StringGetter,trueotherwise
-
StringGetter
public StringGetter(boolean ignoreCase, boolean trimParts) Creates a new empty StringGetter- Parameters:
ignoreCase-falseto create a key sensitive StringGetter,trueotherwisetrimParts-trueto create a StringGetter that omits the leading and trailing whitespaces of both keys and values,falseotherwise
-
StringGetter
Creates a new empty StringGetter- Parameters:
delim- The string used to separate each entry of the StringGetter from the othersassign- The string used to make the association key,value that determines an entry of the StringGetterignoreCase-falseto create a key sensitive StringGetter,trueotherwise
-
StringGetter
Creates a StringGetter and fills it with the values defined by the string passed as parameter- Parameters:
values- The string that defines the entries for the StringGetter. For example (using the standard values for the delimiter and assigner strings): "A=B,C=D"delim- The string used to separate each entry of the StringGetter from the othersassign- The string used to make the association key,value that determines an entry of the StringGetter
-
StringGetter
Creates a new empty StringGetter- Parameters:
delim- The string used to separate each entry of the StringGetter from the othersassign- The string used to make the association key,value that determines an entry of the StringGetter
-
StringGetter
Creates a StringGetter and fills it with the values defined by the string passed as parameter- Parameters:
s- The string that defines the entries for the StringGetter. For example (using the standard values for the delimiter and assigner strings): "A=B,C=D"
-
StringGetter
Creates a StringGetter and fills it with the values defined by the string's array passed as parameter- Parameters:
values- The string's array that defines the entries for the StringGetter. For example (using the standard values for the assigner strings) each entry must respect the formatkey=value
-
StringGetter
Creates a StringGetter and fills it with the values defined by the string passed as parameter- Parameters:
s- The string that defines the entries for the StringGetter. For example (using the standard values for the delimiter and assigner strings): "A=B,C=D"ignoreCase-falseto create a key sensitive StringGetter,trueotherwise
-
-
Method Details
-
setValues
Sets the values of the StringGetter. Each entry of the StringGetter is defined by a key value pair separated by the assigner string (seegetAssigner()). Each entry is separated from the others by the delimiter string (seegetDelimiter()).- Parameters:
values- The string that defines the entries for the StringGetter. For example (using the standard values for the delimiter and assigner strings): "A=B,C=D"
-
setValues
Sets the values of the StringGetter. Each entry is separated from the others by the delimiter string (seegetDelimiter()).- Parameters:
values- The array of string that defines the entries for the StringGetter. For example (using the standard values for the assigner strings) each entry must respect the formatkey=value
-
getDelimiter
Returns the string used to separate each entry of the StringGetter from the others- Returns:
- The string used to separate each entry; the default is the comma character (,)
-
getAssigner
Returns the string used to make the association key,value that determines an entry of the StringGetter- Returns:
- The string used to make the key,value association; the default is the equal character (=)
-
toString
Returns the string representation of the StringGetter- Overrides:
toStringin classProperties- Returns:
- The string representation of the StringGetter
-
getString
Returns the string value associated to the key, or the default one passed as parameter if there isn't an entry with the specified key- Specified by:
getStringin interfaceGetter- Overrides:
getStringin classSerialGetter- Parameters:
key- The key used to search the value in the StringGetterdef- The default value returned if there isn't the desired entry- Returns:
- The value associated to the key, or the default one
-