Class ImmutableDatacenter
- java.lang.Object
-
- com.orbitz.consul.model.coordinate.Datacenter
-
- com.orbitz.consul.model.coordinate.ImmutableDatacenter
-
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableDatacenter extends DatacenterImmutable implementation ofDatacenter.Use the builder to create immutable instances:
ImmutableDatacenter.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableDatacenter.BuilderBuilds instances of typeImmutableDatacenter.
-
Method Summary
Modifier and Type Method Description static ImmutableDatacenter.Builderbuilder()Creates a builder forImmutableDatacenter.static ImmutableDatacentercopyOf(Datacenter instance)Creates an immutable copy of aDatacentervalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofImmutableDatacenterthat have equal attribute values.com.google.common.collect.ImmutableList<Coordinate>getCoordinates()java.lang.StringgetDatacenter()inthashCode()Computes a hash code from attributes:datacenter,coordinates.java.lang.StringtoString()Prints the immutable valueDatacenterwith attribute values.ImmutableDatacenterwithCoordinates(Coordinate... elements)Copy the current immutable object with elements that replace the content ofcoordinates.ImmutableDatacenterwithCoordinates(java.lang.Iterable<? extends Coordinate> elements)Copy the current immutable object with elements that replace the content ofcoordinates.ImmutableDatacenterwithDatacenter(java.lang.String value)Copy the current immutable object by setting a value for thedatacenterattribute.
-
-
-
Method Detail
-
getDatacenter
public java.lang.String getDatacenter()
- Specified by:
getDatacenterin classDatacenter- Returns:
- The value of the
datacenterattribute
-
getCoordinates
public com.google.common.collect.ImmutableList<Coordinate> getCoordinates()
- Specified by:
getCoordinatesin classDatacenter- Returns:
- The value of the
coordinatesattribute
-
withDatacenter
public final ImmutableDatacenter withDatacenter(java.lang.String value)
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
public final ImmutableDatacenter withCoordinates(Coordinate... elements)
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
public final ImmutableDatacenter withCoordinates(java.lang.Iterable<? extends Coordinate> elements)
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
public boolean equals(@Nullable java.lang.Object another)This instance is equal to all instances ofImmutableDatacenterthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()
Computes a hash code from attributes:datacenter,coordinates.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueDatacenterwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
public static ImmutableDatacenter copyOf(Datacenter instance)
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
public static ImmutableDatacenter.Builder builder()
Creates a builder forImmutableDatacenter.ImmutableDatacenter.builder() .datacenter(String) // requireddatacenter.addCoordinates|addAllCoordinates(com.orbitz.consul.model.coordinate.Coordinate) //coordinateselements .build();- Returns:
- A new ImmutableDatacenter builder
-
-