Package com.fauna.event
Class FaunaEvent.Builder<E>
- java.lang.Object
-
- com.fauna.event.FaunaEvent.Builder<E>
-
- Type Parameters:
E
- The type of data contained in the event.
- Enclosing class:
- FaunaEvent<E>
public static final class FaunaEvent.Builder<E> extends java.lang.Object
Builder class for constructing aFaunaEvent
instance.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FaunaEvent<E>
build()
Builds and returns aFaunaEvent
instance.FaunaEvent.Builder<E>
cursor(java.lang.String cursor)
Sets the cursor for the event.FaunaEvent.Builder<E>
error(ErrorInfo error)
Sets the error information for the event.FaunaEvent.Builder<E>
eventType(FaunaEvent.EventType eventType)
Sets the event type.FaunaEvent.Builder<E>
parseData(com.fasterxml.jackson.core.JsonParser parser)
Parses and sets the event data from the given JSON parser.FaunaEvent.Builder<E>
stats(QueryStats stats)
Sets the query statistics for the event.FaunaEvent.Builder<E>
txnTs(java.lang.Long txnTs)
Sets the transaction timestamp for the event.
-
-
-
Method Detail
-
cursor
public FaunaEvent.Builder<E> cursor(java.lang.String cursor)
Sets the cursor for the event.- Parameters:
cursor
- The cursor to set.- Returns:
- This
Builder
instance.
-
eventType
public FaunaEvent.Builder<E> eventType(FaunaEvent.EventType eventType)
Sets the event type.- Parameters:
eventType
- TheFaunaEvent.EventType
of the event.- Returns:
- This
Builder
instance.
-
stats
public FaunaEvent.Builder<E> stats(QueryStats stats)
Sets the query statistics for the event.- Parameters:
stats
- TheQueryStats
to set.- Returns:
- This
Builder
instance.
-
parseData
public FaunaEvent.Builder<E> parseData(com.fasterxml.jackson.core.JsonParser parser)
Parses and sets the event data from the given JSON parser.- Parameters:
parser
- TheJsonParser
to decode the data from.- Returns:
- This
Builder
instance.
-
txnTs
public FaunaEvent.Builder<E> txnTs(java.lang.Long txnTs)
Sets the transaction timestamp for the event.- Parameters:
txnTs
- The transaction timestamp to set.- Returns:
- This
Builder
instance.
-
error
public FaunaEvent.Builder<E> error(ErrorInfo error)
Sets the error information for the event.- Parameters:
error
- TheErrorInfo
containing error details.- Returns:
- This
Builder
instance.
-
build
public FaunaEvent<E> build()
Builds and returns aFaunaEvent
instance.- Returns:
- A new
FaunaEvent
instance.
-
-