Package com.aerisweather.aeris.model
Class AerisBatchResponse
- java.lang.Object
-
- com.aerisweather.aeris.model.AerisBatchResponse
-
public class AerisBatchResponse 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(s) attached to it. This is the response returned from batch request.
-
-
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.List<AerisResponse>
responses
List of AerisResponses returned from the responseboolean
success
Success status of the request.
-
Constructor Summary
Constructors Constructor Description AerisBatchResponse()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static AerisBatchResponse
createObjectWithError(String code, String description)
Creates a JSON String for an AerisResponse with a specific Error code and description.static AerisBatchResponse
fromJSON(org.json.JSONObject jsonObject)
Converts the JSONObject to a AerisBatchResponse using gson parsing.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.
-
responses
public List<AerisResponse> responses
List of AerisResponses returned from the response
-
-
Method Detail
-
fromJSON
public static AerisBatchResponse fromJSON(org.json.JSONObject jsonObject)
Converts the JSONObject to a AerisBatchResponse using gson parsing.- Parameters:
jsonObject
- JSON object to convert- Returns:
- the AerisBatchResponse converted from the object.
-
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.
-
createObjectWithError
public static AerisBatchResponse createObjectWithError(String code, String description)
Creates a JSON String for an AerisResponse with a specific Error code and description.- Parameters:
code
- Code of the errordescription
- description of the error- Returns:
- String JSON object of an AerisResponse with the code and description
-
getError
public AerisError getError()
Gets the error from the response, if there is one.- Returns:
- the error
-
-