Class ImmutableFailover


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

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

    • Method Summary

      Modifier and Type Method Description
      static ImmutableFailover.Builder builder()
      Creates a builder for ImmutableFailover.
      static ImmutableFailover copyOf​(Failover instance)
      Creates an immutable copy of a Failover value.
      java.util.Optional<java.util.List<java.lang.String>> datacenters()  
      boolean equals​(java.lang.Object another)
      This instance is equal to all instances of ImmutableFailover that have equal attribute values.
      java.util.Optional<java.lang.Integer> getNearestN()  
      int hashCode()
      Computes a hash code from attributes: nearestN, datacenters.
      java.lang.String toString()
      Prints the immutable value Failover with attribute values.
      ImmutableFailover withDatacenters​(java.util.List<java.lang.String> value)
      Copy the current immutable object by setting a present value for the optional datacenters attribute.
      ImmutableFailover withDatacenters​(java.util.Optional<? extends java.util.List<java.lang.String>> optional)
      Copy the current immutable object by setting an optional value for the datacenters attribute.
      ImmutableFailover withNearestN​(int value)
      Copy the current immutable object by setting a present value for the optional nearestN attribute.
      ImmutableFailover withNearestN​(java.util.Optional<java.lang.Integer> optional)
      Copy the current immutable object by setting an optional value for the nearestN attribute.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Method Detail

      • getNearestN

        public java.util.Optional<java.lang.Integer> getNearestN()
        Specified by:
        getNearestN in class Failover
        Returns:
        The value of the nearestN attribute
      • datacenters

        public java.util.Optional<java.util.List<java.lang.String>> datacenters()
        Specified by:
        datacenters in class Failover
        Returns:
        The value of the datacenters attribute
      • withNearestN

        public final ImmutableFailover withNearestN​(int value)
        Copy the current immutable object by setting a present value for the optional nearestN attribute.
        Parameters:
        value - The value for nearestN
        Returns:
        A modified copy of this object
      • withNearestN

        public final ImmutableFailover withNearestN​(java.util.Optional<java.lang.Integer> optional)
        Copy the current immutable object by setting an optional value for the nearestN attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
        Parameters:
        optional - A value for nearestN
        Returns:
        A modified copy of this object
      • withDatacenters

        public final ImmutableFailover withDatacenters​(java.util.List<java.lang.String> value)
        Copy the current immutable object by setting a present value for the optional datacenters attribute.
        Parameters:
        value - The value for datacenters
        Returns:
        A modified copy of this object
      • withDatacenters

        public final ImmutableFailover withDatacenters​(java.util.Optional<? extends java.util.List<java.lang.String>> optional)
        Copy the current immutable object by setting an optional value for the datacenters attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
        Parameters:
        optional - A value for datacenters
        Returns:
        A modified copy of this object
      • equals

        public boolean equals​(@Nullable
                              java.lang.Object another)
        This instance is equal to all instances of ImmutableFailover 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: nearestN, datacenters.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        hashCode value
      • toString

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

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