Class MovieHandler

java.lang.Object
moblima.control.handlers.MovieHandler
Direct Known Subclasses:
ReviewHandler

public class MovieHandler extends Object
The type Movie handler.
  • Field Details

    • movies

      protected List<Movie> movies
      The Movies.
    • selectedMovieIdx

      protected int selectedMovieIdx
      The Selected movie idx.
  • Constructor Details

    • MovieHandler

      public MovieHandler()
      Instantiates a new Movie handler.
  • Method Details

    • getSelectedMovie

      public Movie getSelectedMovie()
      Gets selected movie.
      Returns:
      the selected movie
    • setSelectedMovieIdx

      public void setSelectedMovieIdx(int movieIdx)
      Sets selected movie idx.
      Parameters:
      movieIdx - the movie idx
    • getMovie

      public Movie getMovie(int movieIdx)
      Gets movie.
      Parameters:
      movieIdx - the movie idx
      Returns:
      the movie
    • getMovieIdx

      public int getMovieIdx(int movieId)
      Gets movie idx.
      Parameters:
      movieId - the movie id
      Returns:
      the movie idx
    • updateMovieRating

      public boolean updateMovieRating(int movieId, double overallRating)
      Update movie rating boolean.
      Parameters:
      movieId - the movie id
      overallRating - the overall rating
      Returns:
      the boolean
    • getMovies

      public List<Movie> getMovies()
      Gets movies.
      Returns:
      the movies
    • getMovies

      public List<Movie> getMovies(Movie.ShowStatus showStatus)
      Gets movies.
      Parameters:
      showStatus - the show status
      Returns:
      the movies
    • addMovie

      public int addMovie(int id, String title, String synopsis, String director, List<String> castList, int runtime, LocalDate releaseDate, boolean isBlockbuster, Movie.ShowStatus showStatus, Movie.ContentRating contentRating, int overallRating)
      Add movie int.
      Parameters:
      id - the id
      title - the title
      synopsis - the synopsis
      director - the director
      castList - the cast list
      runtime - the runtime
      releaseDate - the release date
      isBlockbuster - the is blockbuster
      showStatus - the show status
      contentRating - the content rating
      overallRating - the overall rating
      Returns:
      the int
    • updateMovie

      public boolean updateMovie(String title, String synopsis, String director, List<String> castList, int runtime, LocalDate releaseDate, boolean isBlockbuster, Movie.ShowStatus showStatus, Movie.ContentRating contentRating, double overallRating)
      Update movie boolean.
      Parameters:
      title - the title
      synopsis - the synopsis
      director - the director
      castList - the cast list
      runtime - the runtime
      releaseDate - the release date
      isBlockbuster - the is blockbuster
      showStatus - the show status
      contentRating - the content rating
      overallRating - the overall rating
      Returns:
      the boolean
    • removeMovie

      public boolean removeMovie(int movieIdx)
      Remove movie boolean.
      Parameters:
      movieIdx - the movie idx
      Returns:
      the boolean
    • printMovies

      public void printMovies()
      Print movies.
    • printMovies

      public void printMovies(List<Movie> movies)
      Print movies.
      Parameters:
      movies - the movies
    • saveMovies

      protected boolean saveMovies()
      Save movies boolean.
      Returns:
      the boolean