@NotThreadSafe public static final class ImmutableAuthenticationSubject.Builder extends Object
ImmutableAuthenticationSubject.
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.
@CanIgnoreReturnValue public final ImmutableAuthenticationSubject.Builder from(AuthenticationSubject instance)
AuthenticationSubject 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 ImmutableAuthenticationSubject.Builder token(@Nullable String token)
token attribute.token - The value for token (can be null)this builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableAuthenticationSubject.Builder roleName(String roleName)
roleName attribute.roleName - The value for roleNamethis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableAuthenticationSubject.Builder isFromExternalAuth(boolean isFromExternalAuth)
isFromExternalAuth attribute.isFromExternalAuth - The value for isFromExternalAuththis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableAuthenticationSubject.Builder putCustomProperties(String key, String value)
customProperties map.key - The key in the customProperties mapvalue - The associated value in the customProperties mapthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableAuthenticationSubject.Builder putCustomProperties(Map.Entry<String,? extends String> entry)
customProperties map. Nulls are not permittedentry - The key and value entrythis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableAuthenticationSubject.Builder customProperties(Map<String,? extends String> entries)
customProperties map. Nulls are not permittedentries - The entries that will be added to the customProperties mapthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableAuthenticationSubject.Builder putAllCustomProperties(Map<String,? extends String> entries)
customProperties map. Nulls are not permittedentries - The entries that will be added to the customProperties mapthis builder for use in a chained invocationpublic ImmutableAuthenticationSubject build()
ImmutableAuthenticationSubject.IllegalStateException - if any required attributes are missingCopyright © 2022. All rights reserved.