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 classBuilds instances of typeImmutableDatacenter. -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableDatacenter.Builderbuilder()Creates a builder forImmutableDatacenter.static ImmutableDatacentercopyOf(Datacenter instance) Creates an immutable copy of aDatacentervalue.booleanThis instance is equal to all instances ofImmutableDatacenterthat have equal attribute values.com.google.common.collect.ImmutableList<Coordinate>inthashCode()Computes a hash code from attributes:datacenter,coordinates.toString()Prints the immutable valueDatacenterwith attribute values.final ImmutableDatacenterwithCoordinates(Iterable<? extends Coordinate> elements) Copy the current immutable object with elements that replace the content ofcoordinates.final ImmutableDatacenterwithCoordinates(Coordinate... elements) Copy the current immutable object with elements that replace the content ofcoordinates.final ImmutableDatacenterwithDatacenter(String value) Copy the current immutable object by setting a value for thedatacenterattribute.
-
Method Details
-
getDatacenter
- Specified by:
getDatacenterin classDatacenter- Returns:
- The value of the
datacenterattribute
-
getCoordinates
- Specified by:
getCoordinatesin classDatacenter- Returns:
- The value of the
coordinatesattribute
-
withDatacenter
Copy the current immutable object by setting a value for thedatacenterattribute. 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
thisobject
-
withCoordinates
Copy the current immutable object with elements that replace the content ofcoordinates.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
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
thisobject
-
equals
This instance is equal to all instances ofImmutableDatacenterthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:datacenter,coordinates. -
toString
Prints the immutable valueDatacenterwith attribute values. -
copyOf
Creates an immutable copy of aDatacentervalue. 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) // requireddatacenter.addCoordinates|addAllCoordinates(org.kiwiproject.consul.model.coordinate.Coordinate) //coordinateselements .build();- Returns:
- A new ImmutableDatacenter builder
-