コード例 #1
0
  void persistMovie(Movie movie) throws Exception {
    String newValue = movieObjectWriter.writeValueAsString(movie);
    String oldValue = movieMap.get(movie.getDbId());

    if (!StringUtils.equals(newValue, oldValue)) {
      // write movie to DB
      movieMap.put(movie.getDbId(), newValue);
    }
  }
コード例 #2
0
 void removeMovieFromDb(Movie movie) throws Exception {
   movieMap.remove(movie.getDbId());
 }