Class MovieDTO.Builder

  • Enclosing class:
    MovieDTO

    public static class MovieDTO.Builder
    extends Object
    Builder used to create a new immutable MovieDTO implementation


    This builder provides a fluent API for setting certain object properties and creating a new immutable MovieDTO 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 Detail

      • Builder

        public Builder()
    • Method Detail

      • from

        public final MovieDTO.Builder from​(Movie instance)
        Fill a builder with attribute values from the provided com.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 provided com.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 to artworks 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 to artworks 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 for artworks 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 to artworks 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 to genres 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 to genres 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 for genres 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 to genres 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 the id attribute.
        Parameters:
        id - The value for id (can be null)
        Returns:
        this builder for use in a chained invocation
      • runtime

        public final MovieDTO.Builder runtime​(@Nullable
                                              Long runtime)
        Initializes the value for the runtime attribute.
        Parameters:
        runtime - The value for runtime (can be null)
        Returns:
        this builder for use in a chained invocation
      • addTrailers

        public final MovieDTO.Builder addTrailers​(Movie.Trailer element)
        Adds one element to trailers 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 to trailers 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 for trailers 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 to trailers 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 to translations 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 to translations 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 for translations 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 to translations 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 the url attribute.
        Parameters:
        url - The value for url (can be null)
        Returns:
        this builder for use in a chained invocation
      • addReleaseDates

        public final MovieDTO.Builder addReleaseDates​(Movie.ReleaseDate element)
        Adds one element to releaseDates 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 to releaseDates 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 for releaseDates 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 to releaseDates 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 to remoteIds 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 to remoteIds 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 for remoteIds 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 to remoteIds list.
        Parameters:
        elements - An iterable of remoteIds elements
        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 the people 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 to people 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