Class ImmutableDatacenter
java.lang.Object
org.kiwiproject.consul.model.coordinate.Datacenter
org.kiwiproject.consul.model.coordinate.ImmutableDatacenter
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableDatacenter
extends Datacenter
Immutable implementation of
Datacenter
.
Use the builder to create immutable instances:
ImmutableDatacenter.builder()
.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Builds instances of typeImmutableDatacenter
. -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableDatacenter.Builder
builder()
Creates a builder forImmutableDatacenter
.static ImmutableDatacenter
copyOf
(Datacenter instance) Creates an immutable copy of aDatacenter
value.boolean
This instance is equal to all instances ofImmutableDatacenter
that have equal attribute values.com.google.common.collect.ImmutableList<Coordinate>
int
hashCode()
Computes a hash code from attributes:datacenter
,coordinates
.toString()
Prints the immutable valueDatacenter
with attribute values.final ImmutableDatacenter
withCoordinates
(Iterable<? extends Coordinate> elements) Copy the current immutable object with elements that replace the content ofcoordinates
.final ImmutableDatacenter
withCoordinates
(Coordinate... elements) Copy the current immutable object with elements that replace the content ofcoordinates
.final ImmutableDatacenter
withDatacenter
(String value) Copy the current immutable object by setting a value for thedatacenter
attribute.
-
Method Details
-
getDatacenter
- Specified by:
getDatacenter
in classDatacenter
- Returns:
- The value of the
datacenter
attribute
-
getCoordinates
- Specified by:
getCoordinates
in classDatacenter
- Returns:
- The value of the
coordinates
attribute
-
withDatacenter
Copy the current immutable object by setting a value for thedatacenter
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for datacenter- Returns:
- A modified copy of the
this
object
-
withCoordinates
Copy the current immutable object with elements that replace the content ofcoordinates
.- Parameters:
elements
- The elements to set- Returns:
- A modified copy of
this
object
-
withCoordinates
Copy the current immutable object with elements that replace the content ofcoordinates
. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
elements
- An iterable of coordinates elements to set- Returns:
- A modified copy of
this
object
-
equals
This instance is equal to all instances ofImmutableDatacenter
that have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:datacenter
,coordinates
. -
toString
Prints the immutable valueDatacenter
with attribute values. -
copyOf
Creates an immutable copy of aDatacenter
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 Datacenter instance
-
builder
Creates a builder forImmutableDatacenter
.ImmutableDatacenter.builder() .datacenter(String) // required
datacenter
.addCoordinates|addAllCoordinates(org.kiwiproject.consul.model.coordinate.Coordinate) //coordinates
elements .build();- Returns:
- A new ImmutableDatacenter builder
-