Class MovieDTO.Builder
- java.lang.Object
-
- com.github.m0nk3y2k4.thetvdb.internal.api.impl.model.data.MovieDTO.Builder
-
- Enclosing class:
- MovieDTO
public static class MovieDTO.Builder extends Object
Builder used to create a new immutableMovieDTO
implementation
This builder provides a fluent API for setting certain object properties and creating a new immutableMovieDTO
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.Builder
addAllArtworks(Iterable<? extends Movie.Artwork> elements)
Adds elements toartworks
list.MovieDTO.Builder
addAllGenres(Iterable<? extends Movie.Genre> elements)
Adds elements togenres
list.MovieDTO.Builder
addAllReleaseDates(Iterable<? extends Movie.ReleaseDate> elements)
Adds elements toreleaseDates
list.MovieDTO.Builder
addAllRemoteIds(Iterable<? extends Movie.RemoteId> elements)
Adds elements toremoteIds
list.MovieDTO.Builder
addAllTrailers(Iterable<? extends Movie.Trailer> elements)
Adds elements totrailers
list.MovieDTO.Builder
addAllTranslations(Iterable<? extends Movie.Translation> elements)
Adds elements totranslations
list.MovieDTO.Builder
addArtworks(Movie.Artwork element)
Adds one element toartworks
list.MovieDTO.Builder
addArtworks(Movie.Artwork... elements)
Adds elements toartworks
list.MovieDTO.Builder
addGenres(Movie.Genre element)
Adds one element togenres
list.MovieDTO.Builder
addGenres(Movie.Genre... elements)
Adds elements togenres
list.MovieDTO.Builder
addReleaseDates(Movie.ReleaseDate element)
Adds one element toreleaseDates
list.MovieDTO.Builder
addReleaseDates(Movie.ReleaseDate... elements)
Adds elements toreleaseDates
list.MovieDTO.Builder
addRemoteIds(Movie.RemoteId element)
Adds one element toremoteIds
list.MovieDTO.Builder
addRemoteIds(Movie.RemoteId... elements)
Adds elements toremoteIds
list.MovieDTO.Builder
addTrailers(Movie.Trailer element)
Adds one element totrailers
list.MovieDTO.Builder
addTrailers(Movie.Trailer... elements)
Adds elements totrailers
list.MovieDTO.Builder
addTranslations(Movie.Translation element)
Adds one element totranslations
list.MovieDTO.Builder
addTranslations(Movie.Translation... elements)
Adds elements totranslations
list.MovieDTO.Builder
artworks(Iterable<? extends Movie.Artwork> elements)
Sets or replaces all elements forartworks
list.MovieDTO
build()
Builds a newMovieDTO
.MovieDTO.Builder
from(Movie instance)
Fill a builder with attribute values from the providedcom.github.m0nk3y2k4.thetvdb.api.model.data.Movie
instance.MovieDTO.Builder
from(MovieDTO instance)
Fill a builder with attribute values from the providedcom.github.m0nk3y2k4.thetvdb.internal.api.impl.model.data.MovieDTO
instance.MovieDTO.Builder
genres(Iterable<? extends Movie.Genre> elements)
Sets or replaces all elements forgenres
list.MovieDTO.Builder
id(Long id)
Initializes the value for theid
attribute.MovieDTO.Builder
people(Map<MovieDTO.PeopleCategory,? extends List<Movie.People>> entries)
Sets or replaces all mappings from the specified map as entries for thepeople
map.MovieDTO.Builder
putAllPeople(Map<MovieDTO.PeopleCategory,? extends List<Movie.People>> entries)
Put all mappings from the specified map as entries topeople
map.MovieDTO.Builder
putPeople(MovieDTO.PeopleCategory key, List<Movie.People> value)
Put one entry to thepeople
map.MovieDTO.Builder
putPeople(Map.Entry<MovieDTO.PeopleCategory,? extends List<Movie.People>> entry)
Put one entry to thepeople
map.MovieDTO.Builder
releaseDates(Iterable<? extends Movie.ReleaseDate> elements)
Sets or replaces all elements forreleaseDates
list.MovieDTO.Builder
remoteIds(Iterable<? extends Movie.RemoteId> elements)
Sets or replaces all elements forremoteIds
list.MovieDTO.Builder
runtime(Long runtime)
Initializes the value for theruntime
attribute.MovieDTO.Builder
trailers(Iterable<? extends Movie.Trailer> elements)
Sets or replaces all elements fortrailers
list.MovieDTO.Builder
translations(Iterable<? extends Movie.Translation> elements)
Sets or replaces all elements fortranslations
list.MovieDTO.Builder
url(String url)
Initializes the value for theurl
attribute.
-
-
-
Method Detail
-
from
public final MovieDTO.Builder from(Movie instance)
Fill a builder with attribute values from the providedcom.github.m0nk3y2k4.thetvdb.api.model.data.Movie
instance.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
from
public final MovieDTO.Builder from(MovieDTO instance)
Fill a builder with attribute values from the providedcom.github.m0nk3y2k4.thetvdb.internal.api.impl.model.data.MovieDTO
instance.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
addArtworks
public final MovieDTO.Builder addArtworks(Movie.Artwork element)
Adds one element toartworks
list.- Parameters:
element
- A artworks element- Returns:
this
builder for use in a chained invocation
-
addArtworks
public final MovieDTO.Builder addArtworks(Movie.Artwork... elements)
Adds elements toartworks
list.- Parameters:
elements
- An array of artworks elements- Returns:
this
builder for use in a chained invocation
-
artworks
public final MovieDTO.Builder artworks(Iterable<? extends Movie.Artwork> elements)
Sets or replaces all elements forartworks
list.- Parameters:
elements
- An iterable of artworks elements- Returns:
this
builder for use in a chained invocation
-
addAllArtworks
public final MovieDTO.Builder addAllArtworks(Iterable<? extends Movie.Artwork> elements)
Adds elements toartworks
list.- Parameters:
elements
- An iterable of artworks elements- Returns:
this
builder for use in a chained invocation
-
addGenres
public final MovieDTO.Builder addGenres(Movie.Genre element)
Adds one element togenres
list.- Parameters:
element
- A genres element- Returns:
this
builder for use in a chained invocation
-
addGenres
public final MovieDTO.Builder addGenres(Movie.Genre... elements)
Adds elements togenres
list.- Parameters:
elements
- An array of genres elements- Returns:
this
builder for use in a chained invocation
-
genres
public final MovieDTO.Builder genres(Iterable<? extends Movie.Genre> elements)
Sets or replaces all elements forgenres
list.- Parameters:
elements
- An iterable of genres elements- Returns:
this
builder for use in a chained invocation
-
addAllGenres
public final MovieDTO.Builder addAllGenres(Iterable<? extends Movie.Genre> elements)
Adds elements togenres
list.- Parameters:
elements
- An iterable of genres elements- Returns:
this
builder for use in a chained invocation
-
id
public final MovieDTO.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
-
runtime
public final MovieDTO.Builder runtime(@Nullable Long runtime)
Initializes the value for theruntime
attribute.- Parameters:
runtime
- The value for runtime (can benull
)- Returns:
this
builder for use in a chained invocation
-
addTrailers
public final MovieDTO.Builder addTrailers(Movie.Trailer element)
Adds one element totrailers
list.- Parameters:
element
- A trailers element- Returns:
this
builder for use in a chained invocation
-
addTrailers
public final MovieDTO.Builder addTrailers(Movie.Trailer... elements)
Adds elements totrailers
list.- Parameters:
elements
- An array of trailers elements- Returns:
this
builder for use in a chained invocation
-
trailers
public final MovieDTO.Builder trailers(Iterable<? extends Movie.Trailer> elements)
Sets or replaces all elements fortrailers
list.- Parameters:
elements
- An iterable of trailers elements- Returns:
this
builder for use in a chained invocation
-
addAllTrailers
public final MovieDTO.Builder addAllTrailers(Iterable<? extends Movie.Trailer> elements)
Adds elements totrailers
list.- Parameters:
elements
- An iterable of trailers elements- Returns:
this
builder for use in a chained invocation
-
addTranslations
public final MovieDTO.Builder addTranslations(Movie.Translation element)
Adds one element totranslations
list.- Parameters:
element
- A translations element- Returns:
this
builder for use in a chained invocation
-
addTranslations
public final MovieDTO.Builder addTranslations(Movie.Translation... elements)
Adds elements totranslations
list.- Parameters:
elements
- An array of translations elements- Returns:
this
builder for use in a chained invocation
-
translations
public final MovieDTO.Builder translations(Iterable<? extends Movie.Translation> elements)
Sets or replaces all elements fortranslations
list.- Parameters:
elements
- An iterable of translations elements- Returns:
this
builder for use in a chained invocation
-
addAllTranslations
public final MovieDTO.Builder addAllTranslations(Iterable<? extends Movie.Translation> elements)
Adds elements totranslations
list.- Parameters:
elements
- An iterable of translations elements- Returns:
this
builder for use in a chained invocation
-
url
public final MovieDTO.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
-
addReleaseDates
public final MovieDTO.Builder addReleaseDates(Movie.ReleaseDate element)
Adds one element toreleaseDates
list.- Parameters:
element
- A releaseDates element- Returns:
this
builder for use in a chained invocation
-
addReleaseDates
public final MovieDTO.Builder addReleaseDates(Movie.ReleaseDate... elements)
Adds elements toreleaseDates
list.- Parameters:
elements
- An array of releaseDates elements- Returns:
this
builder for use in a chained invocation
-
releaseDates
public final MovieDTO.Builder releaseDates(Iterable<? extends Movie.ReleaseDate> elements)
Sets or replaces all elements forreleaseDates
list.- Parameters:
elements
- An iterable of releaseDates elements- Returns:
this
builder for use in a chained invocation
-
addAllReleaseDates
public final MovieDTO.Builder addAllReleaseDates(Iterable<? extends Movie.ReleaseDate> elements)
Adds elements toreleaseDates
list.- Parameters:
elements
- An iterable of releaseDates elements- Returns:
this
builder for use in a chained invocation
-
addRemoteIds
public final MovieDTO.Builder addRemoteIds(Movie.RemoteId element)
Adds one element toremoteIds
list.- Parameters:
element
- A remoteIds element- Returns:
this
builder for use in a chained invocation
-
addRemoteIds
public final MovieDTO.Builder addRemoteIds(Movie.RemoteId... elements)
Adds elements toremoteIds
list.- Parameters:
elements
- An array of remoteIds elements- Returns:
this
builder for use in a chained invocation
-
remoteIds
public final MovieDTO.Builder remoteIds(Iterable<? extends Movie.RemoteId> elements)
Sets or replaces all elements forremoteIds
list.- Parameters:
elements
- An iterable of remoteIds elements- Returns:
this
builder for use in a chained invocation
-
addAllRemoteIds
public final MovieDTO.Builder addAllRemoteIds(Iterable<? extends Movie.RemoteId> elements)
Adds elements toremoteIds
list.- Parameters:
elements
- An iterable of remoteIds elements- Returns:
this
builder for use in a chained invocation
-
putPeople
public final MovieDTO.Builder putPeople(MovieDTO.PeopleCategory key, List<Movie.People> value)
Put one entry to thepeople
map.- Parameters:
key
- The key in the people mapvalue
- The associated value in the people map- Returns:
this
builder for use in a chained invocation
-
putPeople
public final MovieDTO.Builder putPeople(Map.Entry<MovieDTO.PeopleCategory,? extends List<Movie.People>> entry)
Put one entry to thepeople
map. Nulls are not permitted- Parameters:
entry
- The key and value entry- Returns:
this
builder for use in a chained invocation
-
people
public final MovieDTO.Builder people(Map<MovieDTO.PeopleCategory,? extends List<Movie.People>> entries)
Sets or replaces all mappings from the specified map as entries for thepeople
map. Nulls are not permitted- Parameters:
entries
- The entries that will be added to the people map- Returns:
this
builder for use in a chained invocation
-
putAllPeople
public final MovieDTO.Builder putAllPeople(Map<MovieDTO.PeopleCategory,? extends List<Movie.People>> entries)
Put all mappings from the specified map as entries topeople
map. Nulls are not permitted- Parameters:
entries
- The entries that will be added to the people map- Returns:
this
builder for use in a chained invocation
-
build
public MovieDTO build()
Builds a newMovieDTO
.- Returns:
- An immutable instance of MovieDTO
- Throws:
IllegalStateException
- if any required attributes are missing
-
-