S - The type of the builder instance.public static class UserDTO.Builder<S extends UserDTO.Builder>
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected AuditDTO |
audit
The audit information of the user.
|
protected java.lang.String |
name
The name of the user.
|
protected java.util.List<java.lang.String> |
roles
The roles of the user.
|
| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
UserDTO |
build()
Builds an instance of UserDTO using the builder's properties.
|
S |
withAudit(AuditDTO audit)
Sets the audit information of the user.
|
S |
withName(java.lang.String name)
Sets the name of the user.
|
S |
withRoles(java.util.List<java.lang.String> roles)
Sets the roles of the user.
|
protected java.lang.String name
protected java.util.List<java.lang.String> roles
protected AuditDTO audit
public S withName(java.lang.String name)
name - The name of the user.public S withRoles(java.util.List<java.lang.String> roles)
roles - The roles of the user.public S withAudit(AuditDTO audit)
audit - The audit information of the user.public UserDTO build()
java.lang.IllegalArgumentException - If the name or audit are not set.