@NotThreadSafe public static final class ImmutableToken.Builder extends Object
ImmutableToken.
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.
| Modifier and Type | Method and Description |
|---|---|
ImmutableToken.Builder |
addAllPolicies(Iterable<? extends Token.PolicyLink> elements)
Adds elements to
policies list. |
ImmutableToken.Builder |
addPolicies(Token.PolicyLink... elements)
Adds elements to
policies list. |
ImmutableToken.Builder |
addPolicies(Token.PolicyLink element)
Adds one element to
policies list. |
ImmutableToken |
build()
Builds a new
ImmutableToken. |
ImmutableToken.Builder |
description(Optional<String> description)
Initializes the optional value
description to description. |
ImmutableToken.Builder |
description(String description)
Initializes the optional value
description to description. |
ImmutableToken.Builder |
from(Token instance)
Fill a builder with attribute values from the provided
Token instance. |
ImmutableToken.Builder |
id(Optional<String> id)
Initializes the optional value
id to id. |
ImmutableToken.Builder |
id(String id)
Initializes the optional value
id to id. |
ImmutableToken.Builder |
local(boolean local)
Initializes the value for the
local attribute. |
ImmutableToken.Builder |
policies(Iterable<? extends Token.PolicyLink> elements)
Sets or replaces all elements for
policies list. |
@CanIgnoreReturnValue public final ImmutableToken.Builder from(Token instance)
Token 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.instance - The instance from which to copy valuesthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableToken.Builder id(String id)
id to id.id - The value for idthis builder for chained invocation@CanIgnoreReturnValue public final ImmutableToken.Builder id(Optional<String> id)
id to id.id - The value for idthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableToken.Builder description(String description)
description to description.description - The value for descriptionthis builder for chained invocation@CanIgnoreReturnValue public final ImmutableToken.Builder description(Optional<String> description)
description to description.description - The value for descriptionthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableToken.Builder local(boolean local)
local attribute.local - The value for localthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableToken.Builder addPolicies(Token.PolicyLink element)
policies list.element - A policies elementthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableToken.Builder addPolicies(Token.PolicyLink... elements)
policies list.elements - An array of policies elementsthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableToken.Builder policies(Iterable<? extends Token.PolicyLink> elements)
policies list.elements - An iterable of policies elementsthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableToken.Builder addAllPolicies(Iterable<? extends Token.PolicyLink> elements)
policies list.elements - An iterable of policies elementsthis builder for use in a chained invocationpublic ImmutableToken build()
ImmutableToken.IllegalStateException - if any required attributes are missingCopyright © 2019. All rights reserved.