Package de.codecentric.moviedatabase.exception

Examples of de.codecentric.moviedatabase.exception.ResourceNotFoundException


  public void addCommentToMovie(Comment comment, UUID movieId) {
    Assert.notNull(comment);
    Assert.notNull(movieId);
    Movie movie = idToMovieMap.get(movieId);
    if (movie == null){
      throw new ResourceNotFoundException("Movie not found.");
    }
    movie.getComments().add(comment);
  }
View Full Code Here


    Assert.notNull(tag);
    Assert.hasText(tag.getLabel());
    Assert.notNull(movieId);
    Movie movie = idToMovieMap.get(movieId);
    if (movie == null){
      throw new ResourceNotFoundException("Movie not found.");
    }
    movie.getTags().add(tag);
    Set<Movie> movies = tagToMoviesMap.get(tag);
    if (movies == null){
      movies = new HashSet<Movie>();
View Full Code Here

  public void removeTagFromMovie(Tag tag, UUID movieId) {
    Assert.notNull(tag);
    Assert.notNull(movieId);
    Movie movie = idToMovieMap.get(movieId);
    if (movie == null){
      throw new ResourceNotFoundException("Movie not found.");
    }
    movie.getTags().remove(tag);
    Set<Movie> movies = tagToMoviesMap.get(tag);
    if (movies != null){
      movies.remove(movie);
View Full Code Here

  @Override
  public Movie findMovieById(UUID id) {
    Assert.notNull(id);
    Movie movie = idToMovieMap.get(id);
    if (movie == null){
      throw new ResourceNotFoundException("Movie not found.");
    }
    return movie;
  }
View Full Code Here

TOP

Related Classes of de.codecentric.moviedatabase.exception.ResourceNotFoundException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.