Class PartialBotApiMethod<T extends Serializable>
- java.lang.Object
-
- org.telegram.telegrambots.meta.api.methods.PartialBotApiMethod<T>
-
- All Implemented Interfaces:
Validable
- Direct Known Subclasses:
AddStickerToSet,BotApiMethod,CreateNewStickerSet,EditMessageMedia,SendAnimation,SendAudio,SendDocument,SendMediaGroup,SendPhoto,SendSticker,SendVideo,SendVideoNote,SendVoice,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 Modifier and Type Field Description protected static com.fasterxml.jackson.databind.ObjectMapperOBJECT_MAPPER
-
Constructor Summary
Constructors Constructor Description PartialBotApiMethod()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract TdeserializeResponse(String answer)Deserialize a json answer to the response type to a methodTdeserializeResponse(String answer, Class<T> returnClass)<K extends Serializable>
TdeserializeResponseArray(String answer, Class<K> returnClass)protected <K extends Serializable>
TdeserializeResponseSerializable(String answer, Class<K> returnClass)
-
-
-
Method Detail
-
deserializeResponse
public abstract T deserializeResponse(String answer) throws TelegramApiRequestException
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
-
-