Class ImmutablePutOptions.Builder

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

public static final class ImmutablePutOptions.Builder extends Object
Builds instances of type ImmutablePutOptions. 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 ImmutablePutOptions.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 ImmutablePutOptions.Builder from(PutOptions instance)
      Fill a builder with attribute values from the provided org.kiwiproject.consul.option.PutOptions instance.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • addToQueryParameters

      @CanIgnoreReturnValue public final ImmutablePutOptions.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 ImmutablePutOptions.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 ImmutablePutOptions.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 ImmutablePutOptions.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
    • putToHeaders

      @CanIgnoreReturnValue public final ImmutablePutOptions.Builder putToHeaders(String key, String value)
      Put one entry to the toHeaders map.
      Parameters:
      key - The key in the toHeaders map
      value - The associated value in the toHeaders map
      Returns:
      this builder for use in a chained invocation
    • putToHeaders

      @CanIgnoreReturnValue public final ImmutablePutOptions.Builder putToHeaders(Map.Entry<String,? extends String> entry)
      Put one entry to the toHeaders map. Nulls are not permitted
      Parameters:
      entry - The key and value entry
      Returns:
      this builder for use in a chained invocation
    • toHeaders

      @CanIgnoreReturnValue public final ImmutablePutOptions.Builder toHeaders(Map<String,? extends String> entries)
      Sets or replaces all mappings from the specified map as entries for the toHeaders map. Nulls are not permitted
      Parameters:
      entries - The entries that will be added to the toHeaders map
      Returns:
      this builder for use in a chained invocation
    • putAllToHeaders

      @CanIgnoreReturnValue public final ImmutablePutOptions.Builder putAllToHeaders(Map<String,? extends String> entries)
      Put all mappings from the specified map as entries to toHeaders map. Nulls are not permitted
      Parameters:
      entries - The entries that will be added to the toHeaders map
      Returns:
      this builder for use in a chained invocation
    • cas

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

      @CanIgnoreReturnValue public final ImmutablePutOptions.Builder cas(Optional<Long> cas)
      Initializes the optional value cas to cas.
      Parameters:
      cas - The value for cas
      Returns:
      this builder for use in a chained invocation
    • acquire

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

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

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

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

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

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

      @CanIgnoreReturnValue public final ImmutablePutOptions.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 ImmutablePutOptions.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
    • build

      public ImmutablePutOptions build()
      Builds a new ImmutablePutOptions.
      Returns:
      An immutable instance of PutOptions
      Throws:
      IllegalStateException - if any required attributes are missing