Class JsonOrgJSONObjectHelper
- java.lang.Object
-
- net.obvj.confectory.internal.helper.GenericJsonConfigurationHelper<org.json.JSONObject>
-
- net.obvj.confectory.internal.helper.JsonOrgJSONObjectHelper
-
- All Implemented Interfaces:
ConfigurationDataRetriever<org.json.JSONObject>
,ConfigurationHelper<org.json.JSONObject>
public class JsonOrgJSONObjectHelper extends GenericJsonConfigurationHelper<org.json.JSONObject>
A specialized Configuration Helper that retrieves data from JSON.org'sJSONObject
, with JSONPath capabilities.- Since:
- 2.0.0 (note: since 0.2.0 as
JSONObjectConfigurationHelperMapper
) - Author:
- oswaldo.bapvic.jr (Oswaldo Junior)
-
-
Constructor Summary
Constructors Constructor Description JsonOrgJSONObjectHelper(org.json.JSONObject jsonObject)
Creates a new helper for the givenJSONObject
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConfigurationMerger<org.json.JSONObject>
configurationMerger()
String
getAsString()
Double
getDouble(String jsonPath)
Double
getMandatoryDouble(String jsonPath)
-
Methods inherited from class net.obvj.confectory.internal.helper.GenericJsonConfigurationHelper
get, getBean, getBoolean, getInteger, getLong, getMandatoryBoolean, getMandatoryInteger, getMandatoryLong, getMandatoryString, getString
-
-
-
-
Method Detail
-
getDouble
public Double getDouble(String jsonPath)
- Specified by:
getDouble
in interfaceConfigurationDataRetriever<org.json.JSONObject>
- Overrides:
getDouble
in classGenericJsonConfigurationHelper<org.json.JSONObject>
-
getMandatoryDouble
public Double getMandatoryDouble(String jsonPath)
- Specified by:
getMandatoryDouble
in interfaceConfigurationDataRetriever<org.json.JSONObject>
- Overrides:
getMandatoryDouble
in classGenericJsonConfigurationHelper<org.json.JSONObject>
-
configurationMerger
public ConfigurationMerger<org.json.JSONObject> configurationMerger()
-
getAsString
public String getAsString()
- Returns:
- a pretty-printed representation of the
JSONObject
in context - Since:
- 2.5.0
-
-