Class ImmutableCatalogNode


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

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

    • Method Detail

      • getNode

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

        public com.google.common.collect.ImmutableMap<java.lang.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​(java.util.Map<java.lang.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
                              java.lang.Object another)
        This instance is equal to all instances of ImmutableCatalogNode that have equal attribute values.
        Overrides:
        equals in class java.lang.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 java.lang.Object
        Returns:
        hashCode value
      • toString

        public java.lang.String toString()
        Prints the immutable value CatalogNode with attribute values.
        Overrides:
        toString in class java.lang.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(com.orbitz.consul.model.health.Node) // required node
            .putServices|putAllServices(String => com.orbitz.consul.model.health.Service) // services mappings
            .build();
         
        Returns:
        A new ImmutableCatalogNode builder