Package com.mailosaur.models
Class MessageSearchParams
java.lang.Object
com.mailosaur.models.MessageSearchParams
Parameters for message searching.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondir()Optionally limits results based on the direction (`Sent` or `Received`), with the default being `Received`.Gets whether or not an error will not be throw if timeout is reached (default: true).Gets the limit on the number of results to be returned per page.page()Gets the page index, used in conjunction with `itemsPerPage` to support pagination.Gets the receivedAfter timestamp.server()Gets the identifier of the server hosting the messages.timeout()Gets how long to wait for a matching result (in milliseconds).Optionally limits results based on the direction (`Sent` or `Received`), with the default being `Received`.withErrorOnTimeout(boolean errorOnTimeout) Set whether or not an error will not be throw if timeout is reached (default: true).withItemsPerPage(int itemsPerPage) Set the limit on the number of results to be returned per page.withPage(int page) Sets the page index, used in conjunction with `itemsPerPage` to support pagination.withReceivedAfter(long receivedAfter) Limits results to only messages received after this timestamp.withServer(String server) Sets the identifier of the server hosting the messages.withTimeout(int timeout) Sets how long to wait for a matching result (in milliseconds).
-
Constructor Details
-
MessageSearchParams
public MessageSearchParams()
-
-
Method Details
-
server
Gets the identifier of the server hosting the messages.- Returns:
- The identifier of the server hosting the messages.
-
receivedAfter
Gets the receivedAfter timestamp.- Returns:
- The receivedAfter timestamp.
-
page
Gets the page index, used in conjunction with `itemsPerPage` to support pagination.- Returns:
- Gets the page index (for pagination).
-
itemsPerPage
Gets the limit on the number of results to be returned per page. Can be set between 1 and 1000 items, the default is 50.- Returns:
- The number of results to be returned per page.
-
timeout
Gets how long to wait for a matching result (in milliseconds).- Returns:
- The time to wait for a matching result (in milliseconds).
-
errorOnTimeout
Gets whether or not an error will not be throw if timeout is reached (default: true).- Returns:
- Whether or not an error will not be throw if timeout is reached (default: true).
-
dir
Optionally limits results based on the direction (`Sent` or `Received`), with the default being `Received`.- Returns:
- Either `Sent` or `Received`.
-
withServer
Sets the identifier of the server hosting the messages.- Parameters:
server- The identifier of the server hosting the messages.- Returns:
- the MessageSearchParams object itself.
-
withReceivedAfter
Limits results to only messages received after this timestamp.- Parameters:
receivedAfter- Limits results to only messages received after this timestamp.- Returns:
- the MessageSearchParams object itself.
-
withPage
Sets the page index, used in conjunction with `itemsPerPage` to support pagination.- Parameters:
page- Used in conjunction with `itemsPerPage` to support pagination.- Returns:
- the MessageSearchParams object itself.
-
withItemsPerPage
Set the limit on the number of results to be returned per page. Can be set between 1 and 1000 items, the default is 50.- Parameters:
itemsPerPage- A limit on the number of results to be returned per page. Can be set between 1 and 1000 items, the default is 50.- Returns:
- the MessageSearchParams object itself.
-
withTimeout
Sets how long to wait for a matching result (in milliseconds).- Parameters:
timeout- The time to wait for a matching result (in milliseconds).- Returns:
- the MessageSearchParams object itself.
-
withErrorOnTimeout
Set whether or not an error will not be throw if timeout is reached (default: true).- Parameters:
errorOnTimeout- When set to false, an error will not be throw if timeout is reached (default: true).- Returns:
- the MessageSearchParams object itself.
-
withDir
Optionally limits results based on the direction (`Sent` or `Received`), with the default being `Received`.- Parameters:
dir- Can be either `Sent` or `Received`, with the default being `Received`.- Returns:
- the MessageSearchParams object itself.
-