@NotThreadSafe public static final class ImmutableUserCreationResponse.Builder extends Object
ImmutableUserCreationResponse
.
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 |
---|---|
ImmutableUserCreationResponse |
build()
Builds a new
ImmutableUserCreationResponse . |
ImmutableUserCreationResponse.Builder |
created(boolean created)
Initializes the value for the
created attribute. |
ImmutableUserCreationResponse.Builder |
error(Optional<String> error)
Initializes the optional value
error to error. |
ImmutableUserCreationResponse.Builder |
error(String error)
Initializes the optional value
error to error. |
ImmutableUserCreationResponse.Builder |
from(UserCreationResponse instance)
Fill a builder with attribute values from the provided
UserCreationResponse instance. |
ImmutableUserCreationResponse.Builder |
username(String username)
Initializes the value for the
username attribute. |
public final ImmutableUserCreationResponse.Builder from(UserCreationResponse instance)
UserCreationResponse
instance.
Regular attribute values will be replaced with those from the given instance.
Absent optional values will not replace present values.instance
- The instance from which to copy valuesthis
builder for use in a chained invocationpublic final ImmutableUserCreationResponse.Builder username(String username)
username
attribute.username
- The value for usernamethis
builder for use in a chained invocationpublic final ImmutableUserCreationResponse.Builder created(boolean created)
created
attribute.created
- The value for createdthis
builder for use in a chained invocationpublic final ImmutableUserCreationResponse.Builder error(String error)
error
to error.error
- The value for errorthis
builder for chained invocationpublic final ImmutableUserCreationResponse.Builder error(Optional<String> error)
error
to error.error
- The value for errorthis
builder for use in a chained invocationpublic ImmutableUserCreationResponse build()
ImmutableUserCreationResponse
.IllegalStateException
- if any required attributes are missingCopyright © 2023 iland Internet Solutions, Corp. All rights reserved.