Class ImmutableRoleServiceIdentity.Builder

java.lang.Object
org.kiwiproject.consul.model.acl.ImmutableRoleServiceIdentity.Builder
Enclosing class:
ImmutableRoleServiceIdentity

@NotThreadSafe public static final class ImmutableRoleServiceIdentity.Builder extends Object
Builds instances of type ImmutableRoleServiceIdentity. 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 ImmutableRoleServiceIdentity.Builder from(Role.RoleServiceIdentity instance)
      Fill a builder with attribute values from the provided RoleServiceIdentity 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
    • name

      @CanIgnoreReturnValue public final ImmutableRoleServiceIdentity.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
    • addDatacenters

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

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

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

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

      Returns:
      An immutable instance of RoleServiceIdentity
      Throws:
      IllegalStateException - if any required attributes are missing