Package com.jtelegram.api.requests
Class GetUpdates
- java.lang.Object
-
- com.jtelegram.api.requests.framework.AbstractTelegramRequest
-
- com.jtelegram.api.requests.framework.QueryTelegramRequest<Update[]>
-
- com.jtelegram.api.requests.GetUpdates
-
- All Implemented Interfaces:
TelegramRequest
public class GetUpdates extends QueryTelegramRequest<Update[]>
Method for polling and retrieve latest updates
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
GetUpdates.GetUpdatesBuilder
-
Field Summary
-
Fields inherited from class com.jtelegram.api.requests.framework.AbstractTelegramRequest
errorHandler, gson
-
Fields inherited from interface com.jtelegram.api.requests.framework.TelegramRequest
JSON_MEDIA_TYPE
-
-
Constructor Summary
Constructors Constructor Description GetUpdates(java.util.function.Consumer<Update[]> callback, java.util.function.Consumer<TelegramException> errorHandler, int offset, int limit, int timeout, java.util.List<UpdateType> allowedUpdates)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static GetUpdates.GetUpdatesBuilder
builder()
java.util.List<UpdateType>
getAllowedUpdates()
int
getLimit()
int
getOffset()
int
getTimeout()
protected boolean
isValid()
Checks validity of this request.java.lang.String
toString()
-
Methods inherited from class com.jtelegram.api.requests.framework.QueryTelegramRequest
canEqual, equals, handleResponse, hashCode, setCallback
-
Methods inherited from class com.jtelegram.api.requests.framework.AbstractTelegramRequest
getBody, getEndPoint, handleError, handleException, serialize, setErrorHandler, validate
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.jtelegram.api.requests.framework.TelegramRequest
build
-
-
-
-
Constructor Detail
-
GetUpdates
public GetUpdates(java.util.function.Consumer<Update[]> callback, java.util.function.Consumer<TelegramException> errorHandler, int offset, int limit, int timeout, java.util.List<UpdateType> allowedUpdates)
-
-
Method Detail
-
isValid
protected boolean isValid()
Description copied from class:QueryTelegramRequest
Checks validity of this request. Internal method used before sending.- Specified by:
isValid
in classQueryTelegramRequest<Update[]>
- Returns:
- If it's valid
-
builder
public static GetUpdates.GetUpdatesBuilder builder()
-
getOffset
public int getOffset()
-
getLimit
public int getLimit()
-
getTimeout
public int getTimeout()
-
getAllowedUpdates
public java.util.List<UpdateType> getAllowedUpdates()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-