Package io.dialob.client.api
Class ImmutableCurrentUser.Builder
- java.lang.Object
-
- io.dialob.client.api.ImmutableCurrentUser.Builder
-
- Enclosing class:
- ImmutableCurrentUser
@NotThreadSafe public static final class ImmutableCurrentUser.Builder extends Object
Builds instances of typeImmutableCurrentUser. Initialize attributes and then invoke thebuild()method to create an immutable instance.Builderis not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImmutableCurrentUserbuild()Builds a newImmutableCurrentUser.ImmutableCurrentUser.Builderemail(String email)Initializes the value for theemailattribute.ImmutableCurrentUser.Builderfrom(CurrentUserSupplier.CurrentUser instance)Fill a builder with attribute values from the providedCurrentUserinstance.ImmutableCurrentUser.Builderuser(String user)Initializes the value for theuserattribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableCurrentUser.Builder from(CurrentUserSupplier.CurrentUser instance)
Fill a builder with attribute values from the providedCurrentUserinstance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
user
@CanIgnoreReturnValue public final ImmutableCurrentUser.Builder user(String user)
Initializes the value for theuserattribute.- Parameters:
user- The value for user- Returns:
thisbuilder for use in a chained invocation
-
email
@CanIgnoreReturnValue public final ImmutableCurrentUser.Builder email(String email)
Initializes the value for theemailattribute.- Parameters:
email- The value for email- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableCurrentUser build()
Builds a newImmutableCurrentUser.- Returns:
- An immutable instance of CurrentUser
- Throws:
IllegalStateException- if any required attributes are missing
-
-