Class ImmutableFailover.Builder

java.lang.Object
org.kiwiproject.consul.model.query.ImmutableFailover.Builder
Enclosing class:
ImmutableFailover

public static final class ImmutableFailover.Builder extends 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 Details

    • 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(Optional<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(List<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(Optional<? extends List<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:
      IllegalStateException - if any required attributes are missing