Class ImmutableEventOptions

java.lang.Object
org.kiwiproject.consul.option.EventOptions
org.kiwiproject.consul.option.ImmutableEventOptions
All Implemented Interfaces:
ParamAdder

@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableEventOptions extends EventOptions
Immutable implementation of EventOptions.

Use the builder to create immutable instances: ImmutableEventOptions.builder().

  • Method Details

    • toQueryParameters

      public com.google.common.collect.ImmutableList<String> toQueryParameters()
      Returns:
      The value of the toQueryParameters attribute
    • toHeaders

      public com.google.common.collect.ImmutableMap<String,String> toHeaders()
      Returns:
      The value of the toHeaders attribute
    • getDatacenter

      public Optional<String> getDatacenter()
      Specified by:
      getDatacenter in class EventOptions
      Returns:
      The value of the datacenter attribute
    • getNodeFilter

      public Optional<String> getNodeFilter()
      Specified by:
      getNodeFilter in class EventOptions
      Returns:
      The value of the nodeFilter attribute
    • getServiceFilter

      public Optional<String> getServiceFilter()
      Specified by:
      getServiceFilter in class EventOptions
      Returns:
      The value of the serviceFilter attribute
    • getTagFilter

      public Optional<String> getTagFilter()
      Specified by:
      getTagFilter in class EventOptions
      Returns:
      The value of the tagFilter attribute
    • withToQueryParameters

      public final ImmutableEventOptions withToQueryParameters(String... elements)
      Copy the current immutable object with elements that replace the content of toQueryParameters.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withToQueryParameters

      public final ImmutableEventOptions withToQueryParameters(Iterable<String> elements)
      Copy the current immutable object with elements that replace the content of toQueryParameters. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of toQueryParameters elements to set
      Returns:
      A modified copy of this object
    • withToHeaders

      public final ImmutableEventOptions withToHeaders(Map<String,? extends String> entries)
      Copy the current immutable object by replacing the toHeaders map with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      entries - The entries to be added to the toHeaders map
      Returns:
      A modified copy of this object
    • withDatacenter

      public final ImmutableEventOptions withDatacenter(String value)
      Copy the current immutable object by setting a present value for the optional datacenter attribute.
      Parameters:
      value - The value for datacenter
      Returns:
      A modified copy of this object
    • withDatacenter

      public final ImmutableEventOptions withDatacenter(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the datacenter attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for datacenter
      Returns:
      A modified copy of this object
    • withNodeFilter

      public final ImmutableEventOptions withNodeFilter(String value)
      Copy the current immutable object by setting a present value for the optional nodeFilter attribute.
      Parameters:
      value - The value for nodeFilter
      Returns:
      A modified copy of this object
    • withNodeFilter

      public final ImmutableEventOptions withNodeFilter(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the nodeFilter attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for nodeFilter
      Returns:
      A modified copy of this object
    • withServiceFilter

      public final ImmutableEventOptions withServiceFilter(String value)
      Copy the current immutable object by setting a present value for the optional serviceFilter attribute.
      Parameters:
      value - The value for serviceFilter
      Returns:
      A modified copy of this object
    • withServiceFilter

      public final ImmutableEventOptions withServiceFilter(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the serviceFilter attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for serviceFilter
      Returns:
      A modified copy of this object
    • withTagFilter

      public final ImmutableEventOptions withTagFilter(String value)
      Copy the current immutable object by setting a present value for the optional tagFilter attribute.
      Parameters:
      value - The value for tagFilter
      Returns:
      A modified copy of this object
    • withTagFilter

      public final ImmutableEventOptions withTagFilter(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the tagFilter attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for tagFilter
      Returns:
      A modified copy of this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableEventOptions that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: toQueryParameters, toHeaders, datacenter, nodeFilter, serviceFilter, tagFilter.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value EventOptions with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • copyOf

      public static ImmutableEventOptions copyOf(EventOptions instance)
      Creates an immutable copy of a EventOptions value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
      Parameters:
      instance - The instance to copy
      Returns:
      A copied immutable EventOptions instance
    • builder

      public static ImmutableEventOptions.Builder builder()
      Creates a builder for ImmutableEventOptions.
       ImmutableEventOptions.builder()
          .addToQueryParameters|addAllToQueryParameters(String) // toQueryParameters elements
          .putToHeaders|putAllToHeaders(String => String) // toHeaders mappings
          .datacenter(String) // optional datacenter
          .nodeFilter(String) // optional nodeFilter
          .serviceFilter(String) // optional serviceFilter
          .tagFilter(String) // optional tagFilter
          .build();
       
      Returns:
      A new ImmutableEventOptions builder