Closed dvt32 closed 1 week ago
Currently we have something like:
if (movieDetails.getTitle() != null) { existingMovie.setTitle(movieDetails.getTitle()); } if (movieDetails.getDescription() != null) { existingMovie.setDescription(movieDetails.getDescription()); } if (movieDetails.getRating() != null) { existingMovie.setRating(movieDetails.getRating()); } if (movieDetails.getReleaseDate() != null) { existingMovie.setReleaseDate(movieDetails.getReleaseDate()); } if (movieDetails.getDirector() != null) { existingMovie.setDirector(movieDetails.getDirector()); } if (movieDetails.getWriter() != null) { existingMovie.setWriter(movieDetails.getWriter()); } if (movieDetails.getStars() != null) { existingMovie.setStars(movieDetails.getStars()); } if (movieDetails.getDuration() != null) { existingMovie.setDuration(movieDetails.getDuration()); } if (movieDetails.getImdbId() != null) { existingMovie.setImdbId(movieDetails.getImdbId()); } if (movieDetails.getYear() != null) { existingMovie.setYear(movieDetails.getYear()); }
Find a way to refactor and simplify the method, so that it's easier to maintain if we introduce more fields for movies and TV shows.
It took for a while but done :)
Currently we have something like:
Find a way to refactor and simplify the method, so that it's easier to maintain if we introduce more fields for movies and TV shows.