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 immutableUserDTOimplementation
This builder provides a fluent API for setting certain object properties and creating a new immutableUserDTOinstance 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 UserDTObuild()Builds a newUserDTO.UserDTO.BuilderfavoritesDisplaymode(String favoritesDisplaymode)Initializes the value for thefavoritesDisplaymodeattribute.UserDTO.Builderfrom(User instance)Fill a builder with attribute values from the providedcom.github.m0nk3y2k4.thetvdb.api.model.data.Userinstance.UserDTO.Builderfrom(UserDTO instance)Fill a builder with attribute values from the providedcom.github.m0nk3y2k4.thetvdb.internal.api.impl.model.data.UserDTOinstance.UserDTO.Builderlanguage(String language)Initializes the value for thelanguageattribute.UserDTO.BuilderuserName(String userName)Initializes the value for theuserNameattribute.
-
-
-
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.Userinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder 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.UserDTOinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
favoritesDisplaymode
public final UserDTO.Builder favoritesDisplaymode(@Nullable String favoritesDisplaymode)
Initializes the value for thefavoritesDisplaymodeattribute.- Parameters:
favoritesDisplaymode- The value for favoritesDisplaymode (can benull)- Returns:
thisbuilder for use in a chained invocation
-
language
public final UserDTO.Builder language(@Nullable String language)
Initializes the value for thelanguageattribute.- Parameters:
language- The value for language (can benull)- Returns:
thisbuilder for use in a chained invocation
-
userName
public final UserDTO.Builder userName(@Nullable String userName)
Initializes the value for theuserNameattribute.- Parameters:
userName- The value for userName (can benull)- Returns:
thisbuilder 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
-
-