Class ImmutableCoord
java.lang.Object
org.kiwiproject.consul.model.coordinate.Coord
org.kiwiproject.consul.model.coordinate.ImmutableCoord
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@Immutable
@CheckReturnValue
public final class ImmutableCoord
extends Coord
Immutable implementation of
Coord
.
Use the builder to create immutable instances:
ImmutableCoord.builder()
.
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableCoord.Builder
builder()
Creates a builder forImmutableCoord
.static ImmutableCoord
Creates an immutable copy of aCoord
value.boolean
This instance is equal to all instances ofImmutableCoord
that have equal attribute values.double
double
getError()
double
double[]
getVec()
int
hashCode()
Computes a hash code from attributes:adjustment
,error
,height
,vec
.toString()
Prints the immutable valueCoord
with attribute values.final ImmutableCoord
withAdjustment
(double value) Copy the current immutable object by setting a value for theadjustment
attribute.final ImmutableCoord
withError
(double value) Copy the current immutable object by setting a value for theerror
attribute.final ImmutableCoord
withHeight
(double value) Copy the current immutable object by setting a value for theheight
attribute.final ImmutableCoord
withVec
(double... elements) Copy the current immutable object with elements that replace the content ofvec
.
-
Method Details
-
getAdjustment
public double getAdjustment()- Specified by:
getAdjustment
in classCoord
- Returns:
- The value of the
adjustment
attribute
-
getError
public double getError() -
getHeight
public double getHeight() -
getVec
public double[] getVec() -
withAdjustment
Copy the current immutable object by setting a value for theadjustment
attribute. 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
this
object
-
withError
Copy the current immutable object by setting a value for theerror
attribute. 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
this
object
-
withHeight
Copy the current immutable object by setting a value for theheight
attribute. 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
this
object
-
withVec
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
this
object
-
equals
This instance is equal to all instances ofImmutableCoord
that have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:adjustment
,error
,height
,vec
. -
toString
Prints the immutable valueCoord
with attribute values. -
copyOf
Creates an immutable copy of aCoord
value. 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
Creates a builder forImmutableCoord
.ImmutableCoord.builder() .adjustment(double) // required
adjustment
.error(double) // requirederror
.height(double) // requiredheight
.vec(double) // requiredvec
.build();- Returns:
- A new ImmutableCoord builder
-