Package com.aerisweather.aeris.model
Class AerisBasics
- java.lang.Object
-
- com.aerisweather.aeris.model.AerisBasics
-
- Direct Known Subclasses:
AerisCustomResponse
public class AerisBasics extends Object
The basic response from the Aeris API. Generally all responses from Aeris will have a success boolean, than error string or an object attached to it.
-
-
Field Summary
Fields Modifier and Type Field Description AerisError
error
AerisError
returned from the response.The error property will always be null if the request was successful, results were returned and there were no errors or warnings.boolean
success
Success status of the request.
-
Constructor Summary
Constructors Constructor Description AerisBasics()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
fromJSON(String json)
Construction from a JSON object.AerisError
getError()
Gets the error from the response, if there is one.boolean
isSuccessful()
Gets the success of the response.
-
-
-
Field Detail
-
success
public boolean success
Success status of the request.
-
error
public AerisError error
AerisError
returned from the response.The error property will always be null if the request was successful, results were returned and there were no errors or warnings.
-
-
Method Detail
-
fromJSON
public void fromJSON(String json)
Construction from a JSON object. This constructor is needed to properly pull the JSON as the JSON response field can be an array or just a single object, so this helps fix that.- Parameters:
json
- Json object to use to construct the AerisResponse
-
isSuccessful
public boolean isSuccessful()
Gets the success of the response. Returns true if the response was sucessful or had a warning.- Returns:
- true if the response was successful.
-
getError
public AerisError getError()
Gets the error from the response, if there is one.- Returns:
- the error
-
-