Class ImmutableCoordinate
- java.lang.Object
-
- com.orbitz.consul.model.coordinate.Coordinate
-
- com.orbitz.consul.model.coordinate.ImmutableCoordinate
-
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableCoordinate extends CoordinateImmutable implementation ofCoordinate.Use the builder to create immutable instances:
ImmutableCoordinate.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableCoordinate.BuilderBuilds instances of typeImmutableCoordinate.
-
Method Summary
Modifier and Type Method Description static ImmutableCoordinate.Builderbuilder()Creates a builder forImmutableCoordinate.static ImmutableCoordinatecopyOf(Coordinate instance)Creates an immutable copy of aCoordinatevalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofImmutableCoordinatethat have equal attribute values.CoordgetCoord()java.lang.StringgetNode()inthashCode()Computes a hash code from attributes:node,coord.java.lang.StringtoString()Prints the immutable valueCoordinatewith attribute values.ImmutableCoordinatewithCoord(Coord value)Copy the current immutable object by setting a value for thecoordattribute.ImmutableCoordinatewithNode(java.lang.String value)Copy the current immutable object by setting a value for thenodeattribute.
-
-
-
Method Detail
-
getNode
public java.lang.String getNode()
- Specified by:
getNodein classCoordinate- Returns:
- The value of the
nodeattribute
-
getCoord
public Coord getCoord()
- Specified by:
getCoordin classCoordinate- Returns:
- The value of the
coordattribute
-
withNode
public final ImmutableCoordinate withNode(java.lang.String value)
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
public final ImmutableCoordinate withCoord(Coord value)
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
public boolean equals(@Nullable java.lang.Object another)This instance is equal to all instances ofImmutableCoordinatethat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()
Computes a hash code from attributes:node,coord.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueCoordinatewith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
public static ImmutableCoordinate copyOf(Coordinate instance)
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
public static ImmutableCoordinate.Builder builder()
Creates a builder forImmutableCoordinate.ImmutableCoordinate.builder() .node(String) // requirednode.coord(com.orbitz.consul.model.coordinate.Coord) // requiredcoord.build();- Returns:
- A new ImmutableCoordinate builder
-
-