July 2018
Intermediate to advanced
268 pages
7h 36m
English
We will be using hardcoded movies as our data structure for this sample and will write methods in a reactive way, to expose methods in our repository class. These methods can be used to manipulate the data structure of the movies. Our repository class is a conventional one, but the right data structures, in the form of Mono and Flux, aid in bringing a reactive nature to the application:
@Repositorypublic class MovieRepositoryImpl implements MovieRepository { private Map<Long, Movie> movies = new HashMap<Long, Movie>(); @PostConstruct public void initIt() throws Exception { movies.put(Long.valueOf(1), new Movie(Long.valueOf(1), "Moonlight", "Drama")); movies.put(Long.valueOf(2), new Movie(Long.valueOf(2), "Dunkirk", "Drama/Thriller")); ...Read now
Unlock full access