Class ImmutableFailover.Builder

  • Enclosing class:
    ImmutableFailover

    @NotThreadSafe
    public static final class ImmutableFailover.Builder
    extends java.lang.Object
    Builds instances of type ImmutableFailover. Initialize attributes and then invoke the build() method to create an immutable instance.

    Builder is not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.

    • Method Detail

      • from

        @CanIgnoreReturnValue
        public final ImmutableFailover.Builder from​(Failover instance)
        Fill a builder with attribute values from the provided Failover instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.
        Parameters:
        instance - The instance from which to copy values
        Returns:
        this builder for use in a chained invocation
      • nearestN

        @CanIgnoreReturnValue
        public final ImmutableFailover.Builder nearestN​(int nearestN)
        Initializes the optional value nearestN to nearestN.
        Parameters:
        nearestN - The value for nearestN
        Returns:
        this builder for chained invocation
      • nearestN

        @CanIgnoreReturnValue
        public final ImmutableFailover.Builder nearestN​(java.util.Optional<java.lang.Integer> nearestN)
        Initializes the optional value nearestN to nearestN.
        Parameters:
        nearestN - The value for nearestN
        Returns:
        this builder for use in a chained invocation
      • datacenters

        @CanIgnoreReturnValue
        public final ImmutableFailover.Builder datacenters​(java.util.List<java.lang.String> datacenters)
        Initializes the optional value datacenters to datacenters.
        Parameters:
        datacenters - The value for datacenters
        Returns:
        this builder for chained invocation
      • datacenters

        @CanIgnoreReturnValue
        public final ImmutableFailover.Builder datacenters​(java.util.Optional<? extends java.util.List<java.lang.String>> datacenters)
        Initializes the optional value datacenters to datacenters.
        Parameters:
        datacenters - The value for datacenters
        Returns:
        this builder for use in a chained invocation
      • build

        public ImmutableFailover build()
        Builds a new ImmutableFailover.
        Returns:
        An immutable instance of Failover
        Throws:
        java.lang.IllegalStateException - if any required attributes are missing