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().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableCatalogNode. -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableCatalogNode.Builderbuilder()Creates a builder forImmutableCatalogNode.static ImmutableCatalogNodecopyOf(CatalogNode instance) Creates an immutable copy of aCatalogNodevalue.booleanThis instance is equal to all instances ofImmutableCatalogNodethat have equal attribute values.getNode()inthashCode()Computes a hash code from attributes:node,services.toString()Prints the immutable valueCatalogNodewith attribute values.final ImmutableCatalogNodeCopy the current immutable object by setting a value for thenodeattribute.final ImmutableCatalogNodewithServices(Map<String, ? extends Service> entries) Copy the current immutable object by replacing theservicesmap with the specified map.
-
Method Details
-
getNode
- Specified by:
getNodein classCatalogNode- Returns:
- The value of the
nodeattribute
-
getServices
- Specified by:
getServicesin classCatalogNode- Returns:
- The value of the
servicesattribute
-
withNode
Copy the current immutable object by setting a value for thenodeattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for node- Returns:
- A modified copy of the
thisobject
-
withServices
Copy the current immutable object by replacing theservicesmap 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 returningthis.- Parameters:
entries- The entries to be added to the services map- Returns:
- A modified copy of
thisobject
-
equals
This instance is equal to all instances ofImmutableCatalogNodethat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:node,services. -
toString
Prints the immutable valueCatalogNodewith attribute values. -
copyOf
Creates an immutable copy of aCatalogNodevalue. 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
Creates a builder forImmutableCatalogNode.ImmutableCatalogNode.builder() .node(org.kiwiproject.consul.model.health.Node) // requirednode.putServices|putAllServices(String => org.kiwiproject.consul.model.health.Service) //servicesmappings .build();- Returns:
- A new ImmutableCatalogNode builder
-