Class ImmutableCoordinate
java.lang.Object
org.kiwiproject.consul.model.coordinate.Coordinate
org.kiwiproject.consul.model.coordinate.ImmutableCoordinate
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableCoordinate
extends Coordinate
Immutable implementation of
Coordinate.
Use the builder to create immutable instances:
ImmutableCoordinate.builder().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableCoordinate. -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableCoordinate.Builderbuilder()Creates a builder forImmutableCoordinate.static ImmutableCoordinatecopyOf(Coordinate instance) Creates an immutable copy of aCoordinatevalue.booleanThis instance is equal to all instances ofImmutableCoordinatethat have equal attribute values.getCoord()getNode()inthashCode()Computes a hash code from attributes:node,coord.toString()Prints the immutable valueCoordinatewith attribute values.final ImmutableCoordinateCopy the current immutable object by setting a value for thecoordattribute.final ImmutableCoordinateCopy the current immutable object by setting a value for thenodeattribute.
-
Method Details
-
getNode
- Specified by:
getNodein classCoordinate- Returns:
- The value of the
nodeattribute
-
getCoord
- Specified by:
getCoordin classCoordinate- Returns:
- The value of the
coordattribute
-
withNode
Copy the current immutable object by setting a value for thenodeattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for node- Returns:
- A modified copy of the
thisobject
-
withCoord
Copy the current immutable object by setting a value for thecoordattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for coord- Returns:
- A modified copy of the
thisobject
-
equals
This instance is equal to all instances ofImmutableCoordinatethat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:node,coord. -
toString
Prints the immutable valueCoordinatewith attribute values. -
copyOf
Creates an immutable copy of aCoordinatevalue. 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 Coordinate instance
-
builder
Creates a builder forImmutableCoordinate.ImmutableCoordinate.builder() .node(String) // requirednode.coord(org.kiwiproject.consul.model.coordinate.Coord) // requiredcoord.build();- Returns:
- A new ImmutableCoordinate builder
-