Package net.obvj.confectory
Interface ConfigurationDataRetriever<T>
-
- Type Parameters:
T- the target type which configuration data is to be retrieved
- All Known Subinterfaces:
ConfigurationHelper<T>
- All Known Implementing Classes:
BasicConfigurationHelper,BeanConfigurationHelper,Configuration,DocumentConfigurationHelper,GenericJsonConfigurationHelper,JsonSmartConfigurationHelper,NullConfigurationHelper,PropertiesConfigurationHelper
public interface ConfigurationDataRetriever<T>A base interface for objects that retrieve configuration data.- Since:
- 0.1.0
- Author:
- oswaldo.bapvic.jr (Oswaldo Junior)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Objectget(String key)Returns the object associated with the specifiedkey.StringgetAsString()Returns a string representation of the bean used by this data retriever, typically for manual handling and/or troubleshooting purposes.TgetBean()Returns the configuration bean used by this data retriever, typically for manual handling and/or troubleshooting purposes.BooleangetBoolean(String key)Returns theBooleanobject associated with the specifiedkey.DoublegetDouble(String key)Returns theDoubleobject associated with the specifiedkey.IntegergetInteger(String key)Returns theIntegerobject associated with the specifiedkey.LonggetLong(String key)Returns theLongobject associated with the specifiedkey.BooleangetMandatoryBoolean(String key)Returns theBooleanobject associated with the specifiedkey, throwing an exception if not found.DoublegetMandatoryDouble(String key)Returns theDoubleobject associated with the specifiedkey, throwing an exception if not found.IntegergetMandatoryInteger(String key)Returns theIntegerobject associated with the specifiedkey, throwing an exception if not found.LonggetMandatoryLong(String key)Returns theLongobject associated with the specifiedkey, throwing an exception if not found.StringgetMandatoryString(String key)Returns theStringobject associated with the specifiedkey, throwing an exception if not found.StringgetString(String key)Returns theStringobject associated with the specifiedkey.
-
-
-
Method Detail
-
getBean
T getBean()
Returns the configuration bean used by this data retriever, typically for manual handling and/or troubleshooting purposes.- Returns:
- the configuration bean (Note: it can be
nullif theConfigurationis marked as optional)
-
getAsString
String getAsString()
Returns a string representation of the bean used by this data retriever, typically for manual handling and/or troubleshooting purposes.- Returns:
- a string representation of the configuration bean (Note: it can be
nullif theConfigurationis marked as optional) - Since:
- 2.5.0
-
get
Object get(String key)
Returns the object associated with the specifiedkey.Notes:
- The actual return type may vary depending on the underlying implementation
- On a JSON implementation, the return will usually be an array
- Parameters:
key- the object key (some implementations may also accept a path expression, e.g:JSONPath)- Returns:
- the object object associated with the specified
key. Depending on the actual implementation, the result may be eithernullor an empty array if the specified key is not found - Since:
- 1.2.0
-
getBoolean
Boolean getBoolean(String key)
Returns theBooleanobject associated with the specifiedkey.- Parameters:
key- the object key (some implementations may also accept a path expression, e.g:JSONPath)- Returns:
- the
Booleanobject associated with the specifiedkey;nullif not found
-
getInteger
Integer getInteger(String key)
Returns theIntegerobject associated with the specifiedkey.- Parameters:
key- the object key (some implementations may also accept a path expression, e.g:JSONPath- Returns:
- the
Integerobject associated with the specifiedkey;nullif not found - Throws:
NumberFormatException- if the value is not a parsableint.
-
getLong
Long getLong(String key)
Returns theLongobject associated with the specifiedkey.- Parameters:
key- the object key (some implementations may also accept a path expression, e.g:JSONPath- Returns:
- the
Longobject associated with the specifiedkey;nullif not found - Throws:
NumberFormatException- if the value is not a parsablelong.
-
getDouble
Double getDouble(String key)
Returns theDoubleobject associated with the specifiedkey.- Parameters:
key- the object key (some implementations may also accept a path expression, e.g:JSONPath- Returns:
- the
Doubleobject associated with the specifiedkey;nullif not found - Throws:
NumberFormatException- if the value is not a parsabledouble.
-
getString
String getString(String key)
Returns theStringobject associated with the specifiedkey.- Parameters:
key- the object key (some implementations may also accept a path expression, e.g:JSONPath)- Returns:
- the
Stringobject associated with the specifiedkey;nullif not found
-
getMandatoryBoolean
Boolean getMandatoryBoolean(String key)
Returns theBooleanobject associated with the specifiedkey, throwing an exception if not found.- Parameters:
key- the object key (some implementations may also accept a path expression, e.g:JSONPath)- Returns:
- the
Booleanvalue associated with the specifiedkey; nevernull - Throws:
ConfigurationException- if the specified key (or path) is not found.- Since:
- 0.4.0
-
getMandatoryInteger
Integer getMandatoryInteger(String key)
Returns theIntegerobject associated with the specifiedkey, throwing an exception if not found.- Parameters:
key- the object key (some implementations may also accept a path expression, e.g:JSONPath)- Returns:
- the
Integerobject associated with the specifiedkey; nevernull - Throws:
ConfigurationException- if the specified key (or path) is not found.NumberFormatException- if the value is not a parsableint.- Since:
- 0.4.0
-
getMandatoryLong
Long getMandatoryLong(String key)
Returns theLongobject associated with the specifiedkey, throwing an exception if not found.- Parameters:
key- the object key (some implementations may also accept a path expression, e.g:JSONPath)- Returns:
- the
Longobject associated with the specifiedkey; nevernull - Throws:
ConfigurationException- if the specified key (or path) is not found.NumberFormatException- if the value is not a parsablelong.- Since:
- 0.4.0
-
getMandatoryDouble
Double getMandatoryDouble(String key)
Returns theDoubleobject associated with the specifiedkey, throwing an exception if not found.- Parameters:
key- the object key (some implementations may also accept a path expression, e.g:JSONPath)- Returns:
- the
Doubleobject associated with the specifiedkey; nevernull - Throws:
ConfigurationException- if the specified key (or path) is not found.NumberFormatException- if the value is not a parsabledouble.- Since:
- 0.4.0
-
getMandatoryString
String getMandatoryString(String key)
Returns theStringobject associated with the specifiedkey, throwing an exception if not found.- Parameters:
key- the object key (some implementations may also accept a path expression, e.g:JSONPath)- Returns:
- the
Stringobject associated with the specifiedkey; nevernull - Throws:
ConfigurationException- if the specified key (or path) is not found.- Since:
- 0.4.0
-
-