Class ImmutableQueryOptions.Builder

java.lang.Object
org.kiwiproject.consul.option.ImmutableQueryOptions.Builder
Enclosing class:
ImmutableQueryOptions

public static final class ImmutableQueryOptions.Builder extends 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 Details

    • from

      @CanIgnoreReturnValue public final ImmutableQueryOptions.Builder from(ParamAdder instance)
      Fill a builder with attribute values from the provided org.kiwiproject.consul.option.ParamAdder instance.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • from

      @CanIgnoreReturnValue public final ImmutableQueryOptions.Builder from(QueryOptions instance)
      Fill a builder with attribute values from the provided org.kiwiproject.consul.option.QueryOptions instance.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • addToQueryParameters

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

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

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

      @CanIgnoreReturnValue public final ImmutableQueryOptions.Builder addAllToQueryParameters(Iterable<String> elements)
      Adds elements to toQueryParameters list.
      Parameters:
      elements - An iterable of toQueryParameters elements
      Returns:
      this builder for use in a chained invocation
    • wait

      @CanIgnoreReturnValue public final ImmutableQueryOptions.Builder wait(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(Optional<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(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(Optional<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(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(Optional<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(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(Optional<? extends 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(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(Optional<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(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(Optional<String> datacenter)
      Initializes the optional value datacenter to datacenter.
      Parameters:
      datacenter - The value for datacenter
      Returns:
      this builder for use in a chained invocation
    • filter

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

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

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

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

      @CanIgnoreReturnValue public final ImmutableQueryOptions.Builder wan(boolean wan)
      Initializes the optional value wan to wan.
      Parameters:
      wan - The value for wan
      Returns:
      this builder for chained invocation
    • wan

      @CanIgnoreReturnValue public final ImmutableQueryOptions.Builder wan(Optional<Boolean> wan)
      Initializes the optional value wan to wan.
      Parameters:
      wan - The value for wan
      Returns:
      this builder for use in a chained invocation
    • segment

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

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

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

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

      @CanIgnoreReturnValue public final ImmutableQueryOptions.Builder enable(boolean enable)
      Initializes the optional value enable to enable.
      Parameters:
      enable - The value for enable
      Returns:
      this builder for chained invocation
    • enable

      @CanIgnoreReturnValue public final ImmutableQueryOptions.Builder enable(Optional<Boolean> enable)
      Initializes the optional value enable to enable.
      Parameters:
      enable - The value for enable
      Returns:
      this builder for use in a chained invocation
    • reason

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

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

      @CanIgnoreReturnValue public final ImmutableQueryOptions.Builder addNodeMeta(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(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(Iterable<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(Iterable<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(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(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(Iterable<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(Iterable<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:
      IllegalStateException - if any required attributes are missing