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