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
,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
Modifier and TypeFieldDescriptionprotected static final com.fasterxml.jackson.databind.ObjectMapper
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract T
deserializeResponse
(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 String
Getter for method path (that is the same as method name)
-
Field Details
-
OBJECT_MAPPER
protected static final com.fasterxml.jackson.databind.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
-