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