Class LanguageDTO.Builder
- java.lang.Object
-
- com.github.m0nk3y2k4.thetvdb.internal.api.impl.model.data.LanguageDTO.Builder
-
- Enclosing class:
- LanguageDTO
public static class LanguageDTO.Builder extends Object
Builder used to create a new immutableLanguageDTO
implementation
This builder provides a fluent API for setting certain object properties and creating a new immutableLanguageDTO
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 LanguageDTO.Builder
abbreviation(String abbreviation)
Initializes the value for theabbreviation
attribute.LanguageDTO
build()
Builds a newLanguageDTO
.LanguageDTO.Builder
englishName(String englishName)
Initializes the value for theenglishName
attribute.LanguageDTO.Builder
from(Language instance)
Fill a builder with attribute values from the providedcom.github.m0nk3y2k4.thetvdb.api.model.data.Language
instance.LanguageDTO.Builder
from(LanguageDTO instance)
Fill a builder with attribute values from the providedcom.github.m0nk3y2k4.thetvdb.internal.api.impl.model.data.LanguageDTO
instance.LanguageDTO.Builder
id(Long id)
Initializes the value for theid
attribute.LanguageDTO.Builder
name(String name)
Initializes the value for thename
attribute.
-
-
-
Method Detail
-
from
public final LanguageDTO.Builder from(Language instance)
Fill a builder with attribute values from the providedcom.github.m0nk3y2k4.thetvdb.api.model.data.Language
instance.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
from
public final LanguageDTO.Builder from(LanguageDTO instance)
Fill a builder with attribute values from the providedcom.github.m0nk3y2k4.thetvdb.internal.api.impl.model.data.LanguageDTO
instance.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
abbreviation
public final LanguageDTO.Builder abbreviation(@Nullable String abbreviation)
Initializes the value for theabbreviation
attribute.- Parameters:
abbreviation
- The value for abbreviation (can benull
)- Returns:
this
builder for use in a chained invocation
-
englishName
public final LanguageDTO.Builder englishName(@Nullable String englishName)
Initializes the value for theenglishName
attribute.- Parameters:
englishName
- The value for englishName (can benull
)- Returns:
this
builder for use in a chained invocation
-
id
public final LanguageDTO.Builder id(@Nullable Long id)
Initializes the value for theid
attribute.- Parameters:
id
- The value for id (can benull
)- Returns:
this
builder for use in a chained invocation
-
name
public final LanguageDTO.Builder name(@Nullable String name)
Initializes the value for thename
attribute.- Parameters:
name
- The value for name (can benull
)- Returns:
this
builder for use in a chained invocation
-
build
public LanguageDTO build()
Builds a newLanguageDTO
.- Returns:
- An immutable instance of LanguageDTO
- Throws:
IllegalStateException
- if any required attributes are missing
-
-