Class PartialBotApiMethod<T extends Serializable>
Object
PartialBotApiMethod<T>
- All Implemented Interfaces:
Validable
- Direct Known Subclasses:
AddStickerToSet,BotApiMethod,CreateNewStickerSet,EditMessageMedia,SendMediaBotMethod,SendMediaGroup,SetChatPhoto,UploadStickerFile
public abstract class PartialBotApiMethod<T extends Serializable>
extends Object
implements Validable
- Version:
- 1.0 Api method that can't be use completely as Json
- Author:
- Ruben Bermudez
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract TdeserializeResponse(String answer) Deserialize a json answer to the response type to a methoddeserializeResponse(String answer, Class<T> returnClass) <K extends Serializable>
TdeserializeResponseArray(String answer, Class<K> returnClass) protected <K extends Serializable>
TdeserializeResponseSerializable(String answer, Class<K> returnClass) abstract StringGetter for method path (that is the same as method name)
-
Field Details
-
OBJECT_MAPPER
protected static final ObjectMapper OBJECT_MAPPER
-
-
Constructor Details
-
PartialBotApiMethod
public PartialBotApiMethod()
-
-
Method Details
-
deserializeResponse
Deserialize a json answer to the response type to a method- Parameters:
answer- Json answer received- Returns:
- Answer for the method
- Throws:
TelegramApiRequestException
-
deserializeResponse
public T deserializeResponse(String answer, Class<T> returnClass) throws TelegramApiRequestException - Throws:
TelegramApiRequestException
-
deserializeResponseArray
public <K extends Serializable> T deserializeResponseArray(String answer, Class<K> returnClass) throws TelegramApiRequestException - Throws:
TelegramApiRequestException
-
deserializeResponseSerializable
protected <K extends Serializable> T deserializeResponseSerializable(String answer, Class<K> returnClass) throws TelegramApiRequestException - Throws:
TelegramApiRequestException
-
getMethod
Getter for method path (that is the same as method name)- Returns:
- Method path
-