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 of
NodeId.
Use the builder to create immutable instances:
ImmutableNodeId.builder().
- See Also:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableNodeId.Builderbuilder()Creates a builder forImmutableNodeId.static ImmutableNodeIdCreates an immutable copy of aNodeIdvalue.booleanThis instance is equal to all instances ofImmutableNodeIdthat have equal attribute values.getHost()getId()intgetPort()inthashCode()Computes a hash code from attributes:id,host,port.toString()Prints the immutable valueNodeIdwith attribute values.final ImmutableNodeIdCopy the current immutable object by setting a value for thehostattribute.final ImmutableNodeIdCopy the current immutable object by setting a value for theidattribute.final ImmutableNodeIdwithPort(int value) Copy the current immutable object by setting a value for theportattribute.
-
Method Details
-
getId
-
getHost
-
getPort
public int getPort() -
withId
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
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
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
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
Prints the immutable valueNodeIdwith attribute values. -
copyOf
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
Creates a builder forImmutableNodeId.ImmutableNodeId.builder() .id(String) // requiredid.host(String) // requiredhost.port(int) // requiredport.build();- Returns:
- A new ImmutableNodeId builder
-