Package com.fauna.event
Class FeedOptions.Builder
- java.lang.Object
-
- com.fauna.event.FeedOptions.Builder
-
- Enclosing class:
- FeedOptions
public static class FeedOptions.Builder extends java.lang.Object
Builder class for constructingFeedOptions
instances.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FeedOptions
build()
Builds a newFeedOptions
instance with the configured parameters.FeedOptions.Builder
cursor(java.lang.String cursor)
Sets the cursor.FeedOptions.Builder
pageSize(java.lang.Integer pageSize)
Sets the page size.FeedOptions.Builder
startTs(java.lang.Long startTs)
Sets the start timestamp.FeedOptions.Builder
timeout(java.time.Duration timeout)
Sets the timeout duration.
-
-
-
Method Detail
-
cursor
public FeedOptions.Builder cursor(java.lang.String cursor)
Sets the cursor.- Parameters:
cursor
- AString
representing the cursor.- Returns:
- This
Builder
instance. - Throws:
java.lang.IllegalArgumentException
- ifstartTs
is already set.
-
startTs
public FeedOptions.Builder startTs(java.lang.Long startTs)
Sets the start timestamp.- Parameters:
startTs
- ALong
representing the start timestamp.- Returns:
- This
Builder
instance. - Throws:
java.lang.IllegalArgumentException
- ifcursor
is already set.
-
pageSize
public FeedOptions.Builder pageSize(java.lang.Integer pageSize)
Sets the page size.- Parameters:
pageSize
- AnInteger
specifying the number of items per page.- Returns:
- This
Builder
instance.
-
timeout
public FeedOptions.Builder timeout(java.time.Duration timeout)
Sets the timeout duration.- Parameters:
timeout
- ADuration
specifying the timeout for the feed request.- Returns:
- This
Builder
instance.
-
build
public FeedOptions build()
Builds a newFeedOptions
instance with the configured parameters.- Returns:
- A new
FeedOptions
instance. - Throws:
java.lang.IllegalArgumentException
- if bothcursor
andstartTs
are set.
-
-