public class Result<T extends java.io.Serializable> extends java.lang.Object implements TelegramObject
| Constructor and Description |
|---|
Result(T result)
Constructs a Result.
|
Result(TelegramException exception)
Constructs a Result.
|
| Modifier and Type | Method and Description |
|---|---|
T |
get()
Getter for property
result. |
java.util.Optional<java.lang.String> |
getDescription()
Getter for property
description. |
int |
getErrorCode()
Getter for property
errorCode. |
java.util.Optional<ResponseParameters> |
getResponseParameters()
Getter for property
responseParameters. |
boolean |
ok()
Getter for property
success. |
TelegramException |
toException()
Returns this object as an Exception.
|
public Result(T result)
result - the resultpublic Result(TelegramException exception)
exception - the resultpublic TelegramException toException() throws java.lang.IllegalStateException
java.lang.IllegalStateException - if the method invocation is successful
and no error occurredpublic T get() throws java.lang.IllegalStateException
result.resultjava.lang.IllegalStateException - if the method invocation resulted
in an errorpublic int getErrorCode()
errorCode.errorCodepublic java.util.Optional<java.lang.String> getDescription()
description.descriptionpublic java.util.Optional<ResponseParameters> getResponseParameters()
responseParameters.responseParameters