Class ImmutableQueryOptions.Builder

  • Enclosing class:
    ImmutableQueryOptions

    @NotThreadSafe
    public static final class ImmutableQueryOptions.Builder
    extends java.lang.Object
    Builds instances of type ImmutableQueryOptions. Initialize attributes and then invoke the build() method to create an immutable instance.

    Builder is not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.

    • Method Detail

      • from

        @CanIgnoreReturnValue
        public final ImmutableQueryOptions.Builder from​(QueryOptions instance)
        Fill a builder with attribute values from the provided QueryOptions instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values. Collection elements and entries will be added, not replaced.
        Parameters:
        instance - The instance from which to copy values
        Returns:
        this builder for use in a chained invocation
      • wait

        @CanIgnoreReturnValue
        public final ImmutableQueryOptions.Builder wait​(java.lang.String wait)
        Initializes the optional value wait to wait.
        Parameters:
        wait - The value for wait
        Returns:
        this builder for chained invocation
      • wait

        @CanIgnoreReturnValue
        public final ImmutableQueryOptions.Builder wait​(java.util.Optional<java.lang.String> wait)
        Initializes the optional value wait to wait.
        Parameters:
        wait - The value for wait
        Returns:
        this builder for use in a chained invocation
      • token

        @CanIgnoreReturnValue
        public final ImmutableQueryOptions.Builder token​(java.lang.String token)
        Initializes the optional value token to token.
        Parameters:
        token - The value for token
        Returns:
        this builder for chained invocation
      • token

        @CanIgnoreReturnValue
        public final ImmutableQueryOptions.Builder token​(java.util.Optional<java.lang.String> token)
        Initializes the optional value token to token.
        Parameters:
        token - The value for token
        Returns:
        this builder for use in a chained invocation
      • hash

        @CanIgnoreReturnValue
        public final ImmutableQueryOptions.Builder hash​(java.lang.String hash)
        Initializes the optional value hash to hash.
        Parameters:
        hash - The value for hash
        Returns:
        this builder for chained invocation
      • hash

        @CanIgnoreReturnValue
        public final ImmutableQueryOptions.Builder hash​(java.util.Optional<java.lang.String> hash)
        Initializes the optional value hash to hash.
        Parameters:
        hash - The value for hash
        Returns:
        this builder for use in a chained invocation
      • index

        @CanIgnoreReturnValue
        public final ImmutableQueryOptions.Builder index​(java.math.BigInteger index)
        Initializes the optional value index to index.
        Parameters:
        index - The value for index
        Returns:
        this builder for chained invocation
      • index

        @CanIgnoreReturnValue
        public final ImmutableQueryOptions.Builder index​(java.util.Optional<? extends java.math.BigInteger> index)
        Initializes the optional value index to index.
        Parameters:
        index - The value for index
        Returns:
        this builder for use in a chained invocation
      • near

        @CanIgnoreReturnValue
        public final ImmutableQueryOptions.Builder near​(java.lang.String near)
        Initializes the optional value near to near.
        Parameters:
        near - The value for near
        Returns:
        this builder for chained invocation
      • near

        @CanIgnoreReturnValue
        public final ImmutableQueryOptions.Builder near​(java.util.Optional<java.lang.String> near)
        Initializes the optional value near to near.
        Parameters:
        near - The value for near
        Returns:
        this builder for use in a chained invocation
      • datacenter

        @CanIgnoreReturnValue
        public final ImmutableQueryOptions.Builder datacenter​(java.lang.String datacenter)
        Initializes the optional value datacenter to datacenter.
        Parameters:
        datacenter - The value for datacenter
        Returns:
        this builder for chained invocation
      • datacenter

        @CanIgnoreReturnValue
        public final ImmutableQueryOptions.Builder datacenter​(java.util.Optional<java.lang.String> datacenter)
        Initializes the optional value datacenter to datacenter.
        Parameters:
        datacenter - The value for datacenter
        Returns:
        this builder for use in a chained invocation
      • addNodeMeta

        @CanIgnoreReturnValue
        public final ImmutableQueryOptions.Builder addNodeMeta​(java.lang.String element)
        Adds one element to nodeMeta list.
        Parameters:
        element - A nodeMeta element
        Returns:
        this builder for use in a chained invocation
      • addNodeMeta

        @CanIgnoreReturnValue
        public final ImmutableQueryOptions.Builder addNodeMeta​(java.lang.String... elements)
        Adds elements to nodeMeta list.
        Parameters:
        elements - An array of nodeMeta elements
        Returns:
        this builder for use in a chained invocation
      • nodeMeta

        @CanIgnoreReturnValue
        public final ImmutableQueryOptions.Builder nodeMeta​(java.lang.Iterable<java.lang.String> elements)
        Sets or replaces all elements for nodeMeta list.
        Parameters:
        elements - An iterable of nodeMeta elements
        Returns:
        this builder for use in a chained invocation
      • addAllNodeMeta

        @CanIgnoreReturnValue
        public final ImmutableQueryOptions.Builder addAllNodeMeta​(java.lang.Iterable<java.lang.String> elements)
        Adds elements to nodeMeta list.
        Parameters:
        elements - An iterable of nodeMeta elements
        Returns:
        this builder for use in a chained invocation
      • addTag

        @CanIgnoreReturnValue
        public final ImmutableQueryOptions.Builder addTag​(java.lang.String element)
        Adds one element to tag list.
        Parameters:
        element - A tag element
        Returns:
        this builder for use in a chained invocation
      • addTag

        @CanIgnoreReturnValue
        public final ImmutableQueryOptions.Builder addTag​(java.lang.String... elements)
        Adds elements to tag list.
        Parameters:
        elements - An array of tag elements
        Returns:
        this builder for use in a chained invocation
      • tag

        @CanIgnoreReturnValue
        public final ImmutableQueryOptions.Builder tag​(java.lang.Iterable<java.lang.String> elements)
        Sets or replaces all elements for tag list.
        Parameters:
        elements - An iterable of tag elements
        Returns:
        this builder for use in a chained invocation
      • addAllTag

        @CanIgnoreReturnValue
        public final ImmutableQueryOptions.Builder addAllTag​(java.lang.Iterable<java.lang.String> elements)
        Adds elements to tag list.
        Parameters:
        elements - An iterable of tag elements
        Returns:
        this builder for use in a chained invocation
      • consistencyMode

        @CanIgnoreReturnValue
        public final ImmutableQueryOptions.Builder consistencyMode​(ConsistencyMode consistencyMode)
        Initializes the value for the consistencyMode attribute.

        If not set, this attribute will have a default value as returned by the initializer of consistencyMode.

        Parameters:
        consistencyMode - The value for consistencyMode
        Returns:
        this builder for use in a chained invocation
      • build

        public ImmutableQueryOptions build()
        Builds a new ImmutableQueryOptions.
        Returns:
        An immutable instance of QueryOptions
        Throws:
        java.lang.IllegalStateException - if any required attributes are missing