Package com.orbitz.consul.model.catalog
Class ImmutableCatalogNode
- java.lang.Object
-
- com.orbitz.consul.model.catalog.CatalogNode
-
- com.orbitz.consul.model.catalog.ImmutableCatalogNode
-
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableCatalogNode extends CatalogNodeImmutable implementation ofCatalogNode.Use the builder to create immutable instances:
ImmutableCatalogNode.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableCatalogNode.BuilderBuilds instances of typeImmutableCatalogNode.
-
Method Summary
Modifier and Type Method Description static ImmutableCatalogNode.Builderbuilder()Creates a builder forImmutableCatalogNode.static ImmutableCatalogNodecopyOf(CatalogNode instance)Creates an immutable copy of aCatalogNodevalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofImmutableCatalogNodethat have equal attribute values.NodegetNode()com.google.common.collect.ImmutableMap<java.lang.String,Service>getServices()inthashCode()Computes a hash code from attributes:node,services.java.lang.StringtoString()Prints the immutable valueCatalogNodewith attribute values.ImmutableCatalogNodewithNode(Node value)Copy the current immutable object by setting a value for thenodeattribute.ImmutableCatalogNodewithServices(java.util.Map<java.lang.String,? extends Service> entries)Copy the current immutable object by replacing theservicesmap with the specified map.
-
-
-
Method Detail
-
getNode
public Node getNode()
- Specified by:
getNodein classCatalogNode- Returns:
- The value of the
nodeattribute
-
getServices
public com.google.common.collect.ImmutableMap<java.lang.String,Service> getServices()
- Specified by:
getServicesin classCatalogNode- Returns:
- The value of the
servicesattribute
-
withNode
public final ImmutableCatalogNode withNode(Node value)
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
public final ImmutableCatalogNode withServices(java.util.Map<java.lang.String,? extends Service> entries)
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
public boolean equals(@Nullable java.lang.Object another)This instance is equal to all instances ofImmutableCatalogNodethat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()
Computes a hash code from attributes:node,services.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueCatalogNodewith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
public static ImmutableCatalogNode copyOf(CatalogNode instance)
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
public static ImmutableCatalogNode.Builder builder()
Creates a builder forImmutableCatalogNode.ImmutableCatalogNode.builder() .node(com.orbitz.consul.model.health.Node) // requirednode.putServices|putAllServices(String => com.orbitz.consul.model.health.Service) //servicesmappings .build();- Returns:
- A new ImmutableCatalogNode builder
-
-