Package ch.andre601.fluxpoint4j.request
Class FailedAPIResponse
- java.lang.Object
-
- ch.andre601.fluxpoint4j.request.FailedAPIResponse
-
- All Implemented Interfaces:
GenericAPIResponse
public class FailedAPIResponse extends java.lang.Object implements GenericAPIResponse
Representation of a failed API response containing aerror code
andmessage
.
-
-
Constructor Summary
Constructors Constructor Description FailedAPIResponse()
FailedAPIResponse(java.lang.String message)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getCode()
The returned status code.@Nullable java.lang.String
getMessage()
A possible response message.
-
-
-
Method Detail
-
getCode
public int getCode()
The returned status code.
Anything that isn't a 2xx response should be counted as a failed request.- Specified by:
getCode
in interfaceGenericAPIResponse
- Returns:
- Non-200 Response code from the API.
-
getMessage
@Nullable public @Nullable java.lang.String getMessage()
A possible response message. This is usually empty/null value for successful responses as usually only failed ones will have a message in it.- Specified by:
getMessage
in interfaceGenericAPIResponse
- Returns:
- Message explaining why the request failed.
-
-