Package overit.geocall.util
Class GetterPipe
java.lang.Object
overit.geocall.util.GetterPipe
This utility class allows the creation of a structure for the search of values,
with a specific logic of fields to search for, and possibly fall back to a default value
if the search fails.
-
Constructor Summary
ConstructorsConstructorDescriptionGetterPipe(Iterator<Getter> i, String[] fields, boolean deepFirst, int maxDeep) Constructs a GetterPipe with the specific search parameters and behavioursGetterPipe(Iterator<Getter> i, String field, int maxDeep) Constructs a GetterPipe with the specific search parameters and behaviours.GetterPipe(Getter[] gg, String[] fields, boolean deepFirst) Constructs a GetterPipe that makes the search over the Array ofGetterobjects.GetterPipe(Getter g, String[] fields) Constructs a GetterPipe that makes an amplitude search of the key fields on a singleGetterobject -
Method Summary
Modifier and TypeMethodDescriptionSearches for a generic Object and returns it, or returns the default one if the search failsbooleangetboolean(boolean def) Searches for a boolean value and returns it, or returns the default one if the search failsgetBoolean(Boolean def) Searches for a Boolean value and returns it, or returns the default one if the search failsgetDate(Date def, SimpleDateFormat sdf) Searches for a Date value and returns it, or returns the default one if the search failsdoublegetdouble(double def) Searches for a double value and returns it, or returns the default one if the search failsSearches for a Double value and returns it, or returns the default one if the search failsfloatgetfloat(float def) Searches for a float value and returns it, or returns the default one if the search failsSearches for a Float value and returns it, or returns the default one if the search failsintgetint(int def) Searches for an int value and returns it, or returns the default one if the search failsgetInteger(Integer def) Searches for an Integer value and returns it, or returns the default one if the search failslonggetlong(long def) Searches for a long value and returns it, or returns the default one if the search failsSearches for a Long value and returns it, or returns the default one if the search failsSearches for a string value and returns it, or returns the default one if the search fails
-
Constructor Details
-
GetterPipe
Constructs a GetterPipe that makes an amplitude search of the key fields on a singleGetterobject- Parameters:
g- The Getter object on which perform the searchfields- An Array of strings, each of which used as key for the search
-
GetterPipe
Constructs a GetterPipe that makes the search over the Array ofGetterobjects. The search behaviour depends on the value of thedeepFirstattribute- Parameters:
gg- The Arrays of Getter objects on wich perform the searchfields- An Array of strings, each of which used as key for the searchdeepFirst-truefor a deep search on the Getter elements, and subsequently in amplitude with respect to the Array elements,falseto obtain the opposite search configuration
-
GetterPipe
Constructs a GetterPipe with the specific search parameters and behaviours. The search will be a deep search of the key in the Iterator elements.- Parameters:
i- An elements Iterator on which execute the searchfield- A string used as key for the searchmaxDeep- An integer indicating the maximum depth of the research on the elements of the iterator; If set to zero indicates search with infinite depth i.e. up to the last element of the iterator
-
GetterPipe
Constructs a GetterPipe with the specific search parameters and behaviours- Parameters:
i- An elements Iterator on which execute the searchfields- An Array of strings, each of which used as key for the searchdeepFirst-truefor a deep search on the Iterator elements, and subsequently in amplitude with respect to the Array elements,falseto obtain the opposite search configurationmaxDeep- An integer indicating the maximum depth of the research on the elements of the iterator; If set to zero indicates search with infinite depth i.e. up to the last element of the iterator
-
-
Method Details
-
getString
Searches for a string value and returns it, or returns the default one if the search fails- Parameters:
def- The default value, returned if the search fails- Returns:
- The string, if found, or the default one
-
getint
public int getint(int def) Searches for an int value and returns it, or returns the default one if the search fails- Parameters:
def- The default value, returned if the search fails- Returns:
- The int value, if found, or the default one
-
getInteger
Searches for an Integer value and returns it, or returns the default one if the search fails- Parameters:
def- The default value, returned if the search fails- Returns:
- The Integer value, if found, or the default one
-
getlong
public long getlong(long def) Searches for a long value and returns it, or returns the default one if the search fails- Parameters:
def- The default value, returned if the search fails- Returns:
- The long value, if found, or the default one
-
getLong
Searches for a Long value and returns it, or returns the default one if the search fails- Parameters:
def- The default value, returned if the search fails- Returns:
- The Long value, if found, or the default one
-
getfloat
public float getfloat(float def) Searches for a float value and returns it, or returns the default one if the search fails- Parameters:
def- The default value, returned if the search fails- Returns:
- The float value, if found, or the default one
-
getFloat
Searches for a Float value and returns it, or returns the default one if the search fails- Parameters:
def- The default value, returned if the search fails- Returns:
- The Float value, if found, or the default one
-
getdouble
public double getdouble(double def) Searches for a double value and returns it, or returns the default one if the search fails- Parameters:
def- The default value, returned if the search fails- Returns:
- The double value, if found, or the default one
-
getDouble
Searches for a Double value and returns it, or returns the default one if the search fails- Parameters:
def- The default value, returned if the search fails- Returns:
- The Double value, if found, or the default one
-
getboolean
public boolean getboolean(boolean def) Searches for a boolean value and returns it, or returns the default one if the search fails- Parameters:
def- The default value, returned if the search fails- Returns:
- The boolean value, if found, or the default one
-
getBoolean
Searches for a Boolean value and returns it, or returns the default one if the search fails- Parameters:
def- The default value, returned if the search fails- Returns:
- The Boolean value, if found, or the default one
-
getDate
Searches for a Date value and returns it, or returns the default one if the search fails- Parameters:
def- The default value, returned if the search failssdf- The SimpleDateFormat that defines the format of the date to extract.- Returns:
- The Date value, if found, with the format specified in the SimpleDateFormat, or the default one
-
get
Searches for a generic Object and returns it, or returns the default one if the search fails- Parameters:
def- The default object, returned if the search fails- Returns:
- The object, if found, or the default one
-