Package com.reign.api.kat.models
Class ApiModel
java.lang.Object
com.reign.api.kat.models.ApiModel
- Direct Known Subclasses:
- ApiGuild,- ApiGuildData,- ApiMemberData
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected <T extends ApiModel,Y extends ApiResponse<?>> 
 booleanCommit model data to the api provider.protected static <Y extends ApiResponse<?>>
 YRetrieves data from the API Provider.abstract booleansave()Save the ApiModel to the Api.toString()
- 
Field Details- 
logprotected static final org.slf4j.Logger log
- 
provider
 
- 
- 
Constructor Details- 
ApiModelpublic ApiModel()
 
- 
- 
Method Details- 
toString
- 
savepublic abstract boolean save()Save the ApiModel to the Api.
- 
commitprotected <T extends ApiModel,Y extends ApiResponse<?>> boolean commit(String endpoint, T apiModel, Class<Y> responseClass) Commit model data to the api provider.- Type Parameters:
- T- class of the model extends ApiModel
- Y- class of the response extends ApiResponse
- Parameters:
- endpoint- Endpoint to send the data to.
- apiModel- Model to serialize.
- responseClass- Class of the response object
- Returns:
- boolean if commit was successful.
 
- 
fetchRetrieves data from the API Provider.- Type Parameters:
- Y- extends ApiResponse
- Parameters:
- endpoint- Endpoint to fetch
- responseClass- Response class to serialize into.
- Returns:
- complete response class
 
 
-