Package com.fauna.query
Class QueryOptions.Builder
- java.lang.Object
-
- com.fauna.query.QueryOptions.Builder
-
- Enclosing class:
- QueryOptions
public static class QueryOptions.Builder extends java.lang.Object
Builder class for constructing instances of QueryOptions.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description QueryOptions
build()
Builds and returns a new instance of QueryOptions.QueryOptions.Builder
linearized(boolean linearized)
If true, read-only transactions that don't read indexes are strictly serialized.QueryOptions.Builder
queryTag(java.lang.String key, java.lang.String value)
Adds a single query tag to the existing tags.QueryOptions.Builder
queryTags(QueryTags queryTags)
Sets query tags used to instrument the query.QueryOptions.Builder
timeout(java.time.Duration timeout)
Sets the timeout duration for the query.QueryOptions.Builder
traceParent(java.lang.String traceParent)
Traceparent identifier used for distributed tracing.QueryOptions.Builder
typeCheck(boolean typeCheck)
If true, typechecking is enabled for queries.
-
-
-
Method Detail
-
linearized
public QueryOptions.Builder linearized(boolean linearized)
If true, read-only transactions that don't read indexes are strictly serialized.- Parameters:
linearized
- true to enable linearized reads, false otherwise.- Returns:
- this Builder instance for chaining.
-
typeCheck
public QueryOptions.Builder typeCheck(boolean typeCheck)
If true, typechecking is enabled for queries. You can only enable typechecking for databases that have typechecking enabled.- Parameters:
typeCheck
- true to enable type checking, false otherwise.- Returns:
- this Builder instance for chaining.
-
timeout
public QueryOptions.Builder timeout(java.time.Duration timeout)
Sets the timeout duration for the query.- Parameters:
timeout
- the timeout Duration for the query.- Returns:
- this Builder instance for chaining.
-
queryTags
public QueryOptions.Builder queryTags(QueryTags queryTags)
Sets query tags used to instrument the query. You typically use query tags to monitor and debug query requests in Fauna Logs.- Parameters:
queryTags
- the QueryTags to associate with the query.- Returns:
- this Builder instance for chaining.
-
queryTag
public QueryOptions.Builder queryTag(java.lang.String key, java.lang.String value)
Adds a single query tag to the existing tags.- Parameters:
key
- the key of the query tag.value
- the value of the query tag.- Returns:
- this Builder instance for chaining.
-
traceParent
public QueryOptions.Builder traceParent(java.lang.String traceParent)
Traceparent identifier used for distributed tracing. Passed by the drive in the `traceparent` header of Query HTTP endpoint requests. If you don’t include a traceparent identifier or use an invalid identifier, Fauna generates a valid identifier.- Parameters:
traceParent
- the trace parent ID.- Returns:
- this Builder instance for chaining.
-
build
public QueryOptions build()
Builds and returns a new instance of QueryOptions.- Returns:
- a new QueryOptions instance with the configured settings.
-
-