Class UserDTO.Builder
- java.lang.Object
-
- com.github.m0nk3y2k4.thetvdb.internal.api.impl.model.data.UserDTO.Builder
-
- Enclosing class:
- UserDTO
public static class UserDTO.Builder extends Object
Builder used to create a new immutableUserDTO
implementation
This builder provides a fluent API for setting certain object properties and creating a new immutableUserDTO
instance based on these properties. New builders may be initialized with some existing DTO instance, which presets the builders properties to the values of the given DTO, still retaining the option to make additional changes before actually building a new immutable object.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description UserDTO
build()
Builds a newUserDTO
.UserDTO.Builder
favoritesDisplaymode(String favoritesDisplaymode)
Initializes the value for thefavoritesDisplaymode
attribute.UserDTO.Builder
from(User instance)
Fill a builder with attribute values from the providedcom.github.m0nk3y2k4.thetvdb.api.model.data.User
instance.UserDTO.Builder
from(UserDTO instance)
Fill a builder with attribute values from the providedcom.github.m0nk3y2k4.thetvdb.internal.api.impl.model.data.UserDTO
instance.UserDTO.Builder
language(String language)
Initializes the value for thelanguage
attribute.UserDTO.Builder
userName(String userName)
Initializes the value for theuserName
attribute.
-
-
-
Method Detail
-
from
public final UserDTO.Builder from(User instance)
Fill a builder with attribute values from the providedcom.github.m0nk3y2k4.thetvdb.api.model.data.User
instance.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
from
public final UserDTO.Builder from(UserDTO instance)
Fill a builder with attribute values from the providedcom.github.m0nk3y2k4.thetvdb.internal.api.impl.model.data.UserDTO
instance.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
favoritesDisplaymode
public final UserDTO.Builder favoritesDisplaymode(@Nullable String favoritesDisplaymode)
Initializes the value for thefavoritesDisplaymode
attribute.- Parameters:
favoritesDisplaymode
- The value for favoritesDisplaymode (can benull
)- Returns:
this
builder for use in a chained invocation
-
language
public final UserDTO.Builder language(@Nullable String language)
Initializes the value for thelanguage
attribute.- Parameters:
language
- The value for language (can benull
)- Returns:
this
builder for use in a chained invocation
-
userName
public final UserDTO.Builder userName(@Nullable String userName)
Initializes the value for theuserName
attribute.- Parameters:
userName
- The value for userName (can benull
)- Returns:
this
builder for use in a chained invocation
-
build
public UserDTO build()
Builds a newUserDTO
.- Returns:
- An immutable instance of UserDTO
- Throws:
IllegalStateException
- if any required attributes are missing
-
-