Class ImmutableTaggedAddresses

java.lang.Object
org.kiwiproject.consul.model.catalog.TaggedAddresses
org.kiwiproject.consul.model.catalog.ImmutableTaggedAddresses

@Generated("org.immutables.processor.ProxyProcessor") public final class ImmutableTaggedAddresses extends TaggedAddresses
Immutable implementation of TaggedAddresses.

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

  • Method Details

    • getWan

      public String getWan()
      Specified by:
      getWan in class TaggedAddresses
      Returns:
      The value of the wan attribute
    • getLan

      public Optional<String> getLan()
      Specified by:
      getLan in class TaggedAddresses
      Returns:
      The value of the lan attribute
    • withWan

      public final ImmutableTaggedAddresses withWan(String value)
      Copy the current immutable object by setting a value for the wan attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for wan
      Returns:
      A modified copy of the this object
    • withLan

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

      public final ImmutableTaggedAddresses withLan(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the lan 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 lan
      Returns:
      A modified copy of this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableTaggedAddresses 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: wan, lan.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static ImmutableTaggedAddresses copyOf(TaggedAddresses instance)
      Creates an immutable copy of a TaggedAddresses 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 TaggedAddresses instance
    • builder

      public static ImmutableTaggedAddresses.Builder builder()
      Creates a builder for ImmutableTaggedAddresses.
       ImmutableTaggedAddresses.builder()
          .wan(String) // required wan
          .lan(String) // optional lan
          .build();
       
      Returns:
      A new ImmutableTaggedAddresses builder