Package io.dialob.integration.api
Class ImmutableNodeId
- java.lang.Object
-
- io.dialob.integration.api.ImmutableNodeId
-
- All Implemented Interfaces:
NodeId,Serializable
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable public final class ImmutableNodeId extends Object implements NodeId
Immutable implementation ofNodeId.Use the builder to create immutable instances:
ImmutableNodeId.builder().- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableNodeId.BuilderBuilds instances of typeImmutableNodeId.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableNodeId.Builderbuilder()Creates a builder forImmutableNodeId.static ImmutableNodeIdcopyOf(NodeId instance)Creates an immutable copy of aNodeIdvalue.booleanequals(Object another)This instance is equal to all instances ofImmutableNodeIdthat have equal attribute values.StringgetHost()StringgetId()intgetPort()inthashCode()Computes a hash code from attributes:id,host,port.StringtoString()Prints the immutable valueNodeIdwith attribute values.ImmutableNodeIdwithHost(String value)Copy the current immutable object by setting a value for thehostattribute.ImmutableNodeIdwithId(String value)Copy the current immutable object by setting a value for theidattribute.ImmutableNodeIdwithPort(int value)Copy the current immutable object by setting a value for theportattribute.
-
-
-
Method Detail
-
getId
public String getId()
-
getHost
public String getHost()
-
getPort
public int getPort()
-
withId
public final ImmutableNodeId withId(String value)
Copy the current immutable object by setting a value for theidattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for id- Returns:
- A modified copy of the
thisobject
-
withHost
public final ImmutableNodeId withHost(String value)
Copy the current immutable object by setting a value for thehostattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for host- Returns:
- A modified copy of the
thisobject
-
withPort
public final ImmutableNodeId withPort(int value)
Copy the current immutable object by setting a value for theportattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for port- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableNodeIdthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:id,host,port.
-
toString
public String toString()
Prints the immutable valueNodeIdwith attribute values.
-
copyOf
public static ImmutableNodeId copyOf(NodeId instance)
Creates an immutable copy of aNodeIdvalue. 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 NodeId instance
-
builder
public static ImmutableNodeId.Builder builder()
Creates a builder forImmutableNodeId.ImmutableNodeId.builder() .id(String) // requiredid.host(String) // requiredhost.port(int) // requiredport.build();- Returns:
- A new ImmutableNodeId builder
-
-