Class ImmutableCoord
- java.lang.Object
-
- com.orbitz.consul.model.coordinate.Coord
-
- com.orbitz.consul.model.coordinate.ImmutableCoord
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableCoord.BuilderBuilds instances of typeImmutableCoord.
-
Method Summary
Modifier and Type Method Description static ImmutableCoord.Builderbuilder()Creates a builder forImmutableCoord.static ImmutableCoordcopyOf(Coord instance)Creates an immutable copy of aCoordvalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofImmutableCoordthat have equal attribute values.doublegetAdjustment()doublegetError()doublegetHeight()double[]getVec()inthashCode()Computes a hash code from attributes:adjustment,error,height,vec.java.lang.StringtoString()Prints the immutable valueCoordwith attribute values.ImmutableCoordwithAdjustment(double value)Copy the current immutable object by setting a value for theadjustmentattribute.ImmutableCoordwithError(double value)Copy the current immutable object by setting a value for theerrorattribute.ImmutableCoordwithHeight(double value)Copy the current immutable object by setting a value for theheightattribute.ImmutableCoordwithVec(double... elements)Copy the current immutable object with elements that replace the content ofvec.
-
-
-
Method Detail
-
getAdjustment
public double getAdjustment()
- Specified by:
getAdjustmentin classCoord- Returns:
- The value of the
adjustmentattribute
-
getError
public double getError()
-
getHeight
public double getHeight()
-
withAdjustment
public final ImmutableCoord withAdjustment(double value)
Copy the current immutable object by setting a value for theadjustmentattribute. A value strict bits equality used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for adjustment- Returns:
- A modified copy of the
thisobject
-
withError
public final ImmutableCoord withError(double value)
Copy the current immutable object by setting a value for theerrorattribute. A value strict bits equality used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for error- Returns:
- A modified copy of the
thisobject
-
withHeight
public final ImmutableCoord withHeight(double value)
Copy the current immutable object by setting a value for theheightattribute. A value strict bits equality used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for height- Returns:
- A modified copy of the
thisobject
-
withVec
public final ImmutableCoord withVec(double... elements)
Copy the current immutable object with elements that replace the content ofvec. The array is cloned before being saved as attribute values.- Parameters:
elements- The non-null elements for vec- Returns:
- A modified copy of
thisobject
-
equals
public boolean equals(@Nullable java.lang.Object another)This instance is equal to all instances ofImmutableCoordthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()
Computes a hash code from attributes:adjustment,error,height,vec.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueCoordwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
public static ImmutableCoord copyOf(Coord instance)
Creates an immutable copy of aCoordvalue. 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 Coord instance
-
builder
public static ImmutableCoord.Builder builder()
Creates a builder forImmutableCoord.ImmutableCoord.builder() .adjustment(double) // requiredadjustment.error(double) // requirederror.height(double) // requiredheight.vec(double) // requiredvec.build();- Returns:
- A new ImmutableCoord builder
-
-