Class ImmutableDatacenter


  • @ParametersAreNonnullByDefault
    @Generated("org.immutables.processor.ProxyProcessor")
    @Immutable
    @CheckReturnValue
    public final class ImmutableDatacenter
    extends Datacenter
    Immutable implementation of Datacenter.

    Use the builder to create immutable instances: ImmutableDatacenter.builder().

    • Method Detail

      • getDatacenter

        public java.lang.String getDatacenter()
        Specified by:
        getDatacenter in class Datacenter
        Returns:
        The value of the datacenter attribute
      • getCoordinates

        public com.google.common.collect.ImmutableList<Coordinate> getCoordinates()
        Specified by:
        getCoordinates in class Datacenter
        Returns:
        The value of the coordinates attribute
      • withDatacenter

        public final ImmutableDatacenter withDatacenter​(java.lang.String value)
        Copy the current immutable object by setting a value for the datacenter attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for datacenter
        Returns:
        A modified copy of the this object
      • withCoordinates

        public final ImmutableDatacenter withCoordinates​(Coordinate... elements)
        Copy the current immutable object with elements that replace the content of coordinates.
        Parameters:
        elements - The elements to set
        Returns:
        A modified copy of this object
      • withCoordinates

        public final ImmutableDatacenter withCoordinates​(java.lang.Iterable<? extends Coordinate> elements)
        Copy the current immutable object with elements that replace the content of coordinates. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        elements - An iterable of coordinates elements to set
        Returns:
        A modified copy of this object
      • equals

        public boolean equals​(@Nullable
                              java.lang.Object another)
        This instance is equal to all instances of ImmutableDatacenter that have equal attribute values.
        Overrides:
        equals in class java.lang.Object
        Returns:
        true if this is equal to another instance
      • hashCode

        public int hashCode()
        Computes a hash code from attributes: datacenter, coordinates.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        hashCode value
      • toString

        public java.lang.String toString()
        Prints the immutable value Datacenter with attribute values.
        Overrides:
        toString in class java.lang.Object
        Returns:
        A string representation of the value
      • copyOf

        public static ImmutableDatacenter copyOf​(Datacenter instance)
        Creates an immutable copy of a Datacenter 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

        public static ImmutableDatacenter.Builder builder()
        Creates a builder for ImmutableDatacenter.
         ImmutableDatacenter.builder()
            .datacenter(String) // required datacenter
            .addCoordinates|addAllCoordinates(com.orbitz.consul.model.coordinate.Coordinate) // coordinates elements
            .build();
         
        Returns:
        A new ImmutableDatacenter builder