Class ImmutableCatalogNode

java.lang.Object
org.kiwiproject.consul.model.catalog.CatalogNode
org.kiwiproject.consul.model.catalog.ImmutableCatalogNode

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

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

  • Method Details

    • getNode

      public Node getNode()
      Specified by:
      getNode in class CatalogNode
      Returns:
      The value of the node attribute
    • getServices

      public com.google.common.collect.ImmutableMap<String,Service> getServices()
      Specified by:
      getServices in class CatalogNode
      Returns:
      The value of the services attribute
    • withNode

      public final ImmutableCatalogNode withNode(Node value)
      Copy the current immutable object by setting a value for the node attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for node
      Returns:
      A modified copy of the this object
    • withServices

      public final ImmutableCatalogNode withServices(Map<String,? extends Service> entries)
      Copy the current immutable object by replacing the services 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 services map
      Returns:
      A modified copy of this object
    • equals

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

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

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

      public static ImmutableCatalogNode.Builder builder()
      Creates a builder for ImmutableCatalogNode.
       ImmutableCatalogNode.builder()
          .node(org.kiwiproject.consul.model.health.Node) // required node
          .putServices|putAllServices(String => org.kiwiproject.consul.model.health.Service) // services mappings
          .build();
       
      Returns:
      A new ImmutableCatalogNode builder