Class ImmutableHealthCheck.Builder

java.lang.Object
org.kiwiproject.consul.model.health.ImmutableHealthCheck.Builder
Enclosing class:
ImmutableHealthCheck

@NotThreadSafe public static final class ImmutableHealthCheck.Builder extends Object
Builds instances of type ImmutableHealthCheck. 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 ImmutableHealthCheck.Builder from(HealthCheck instance)
      Fill a builder with attribute values from the provided HealthCheck instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values. Collection elements and entries will be added, not replaced.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • node

      @CanIgnoreReturnValue public final ImmutableHealthCheck.Builder node(String node)
      Initializes the value for the node attribute.
      Parameters:
      node - The value for node
      Returns:
      this builder for use in a chained invocation
    • checkId

      @CanIgnoreReturnValue public final ImmutableHealthCheck.Builder checkId(String checkId)
      Initializes the value for the checkId attribute.
      Parameters:
      checkId - The value for checkId
      Returns:
      this builder for use in a chained invocation
    • name

      @CanIgnoreReturnValue public final ImmutableHealthCheck.Builder name(String name)
      Initializes the value for the name attribute.
      Parameters:
      name - The value for name
      Returns:
      this builder for use in a chained invocation
    • status

      @CanIgnoreReturnValue public final ImmutableHealthCheck.Builder status(String status)
      Initializes the value for the status attribute.
      Parameters:
      status - The value for status
      Returns:
      this builder for use in a chained invocation
    • notes

      @CanIgnoreReturnValue public final ImmutableHealthCheck.Builder notes(String notes)
      Initializes the optional value notes to notes.
      Parameters:
      notes - The value for notes
      Returns:
      this builder for chained invocation
    • notes

      @CanIgnoreReturnValue public final ImmutableHealthCheck.Builder notes(Optional<String> notes)
      Initializes the optional value notes to notes.
      Parameters:
      notes - The value for notes
      Returns:
      this builder for use in a chained invocation
    • output

      @CanIgnoreReturnValue public final ImmutableHealthCheck.Builder output(String output)
      Initializes the optional value output to output.
      Parameters:
      output - The value for output
      Returns:
      this builder for chained invocation
    • output

      @CanIgnoreReturnValue public final ImmutableHealthCheck.Builder output(Optional<String> output)
      Initializes the optional value output to output.
      Parameters:
      output - The value for output
      Returns:
      this builder for use in a chained invocation
    • serviceId

      @CanIgnoreReturnValue public final ImmutableHealthCheck.Builder serviceId(String serviceId)
      Initializes the optional value serviceId to serviceId.
      Parameters:
      serviceId - The value for serviceId
      Returns:
      this builder for chained invocation
    • serviceId

      @CanIgnoreReturnValue public final ImmutableHealthCheck.Builder serviceId(Optional<String> serviceId)
      Initializes the optional value serviceId to serviceId.
      Parameters:
      serviceId - The value for serviceId
      Returns:
      this builder for use in a chained invocation
    • serviceName

      @CanIgnoreReturnValue public final ImmutableHealthCheck.Builder serviceName(String serviceName)
      Initializes the optional value serviceName to serviceName.
      Parameters:
      serviceName - The value for serviceName
      Returns:
      this builder for chained invocation
    • serviceName

      @CanIgnoreReturnValue public final ImmutableHealthCheck.Builder serviceName(Optional<String> serviceName)
      Initializes the optional value serviceName to serviceName.
      Parameters:
      serviceName - The value for serviceName
      Returns:
      this builder for use in a chained invocation
    • addServiceTags

      @CanIgnoreReturnValue public final ImmutableHealthCheck.Builder addServiceTags(String element)
      Adds one element to serviceTags list.
      Parameters:
      element - A serviceTags element
      Returns:
      this builder for use in a chained invocation
    • addServiceTags

      @CanIgnoreReturnValue public final ImmutableHealthCheck.Builder addServiceTags(String... elements)
      Adds elements to serviceTags list.
      Parameters:
      elements - An array of serviceTags elements
      Returns:
      this builder for use in a chained invocation
    • serviceTags

      @CanIgnoreReturnValue public final ImmutableHealthCheck.Builder serviceTags(Iterable<String> elements)
      Sets or replaces all elements for serviceTags list.
      Parameters:
      elements - An iterable of serviceTags elements
      Returns:
      this builder for use in a chained invocation
    • addAllServiceTags

      @CanIgnoreReturnValue public final ImmutableHealthCheck.Builder addAllServiceTags(Iterable<String> elements)
      Adds elements to serviceTags list.
      Parameters:
      elements - An iterable of serviceTags elements
      Returns:
      this builder for use in a chained invocation
    • build

      public ImmutableHealthCheck build()
      Builds a new ImmutableHealthCheck.
      Returns:
      An immutable instance of HealthCheck
      Throws:
      IllegalStateException - if any required attributes are missing