* Use java 11 * Use .of - Replace Arrays.asList with List.of - Replace HashSet<>(List.of()) with Set.of * Formatting
This commit is contained in:
@ -26,7 +26,6 @@ package com.iluwatar.partialresponse;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@ -47,10 +46,13 @@ public class App {
|
||||
* @param args program argument.
|
||||
*/
|
||||
public static void main(String[] args) throws Exception {
|
||||
Map<Integer, Video> videos = new HashMap<>();
|
||||
videos.put(1, new Video(1, "Avatar", 178, "epic science fiction film", "James Cameron", "English"));
|
||||
videos.put(2, new Video(2, "Godzilla Resurgence", 120, "Action & drama movie|", "Hideaki Anno", "Japanese"));
|
||||
videos.put(3, new Video(3, "Interstellar", 169, "Adventure & Sci-Fi", "Christopher Nolan", "English"));
|
||||
Map<Integer, Video> videos = Map.of(
|
||||
1, new Video(1, "Avatar", 178, "epic science fiction film",
|
||||
"James Cameron", "English"),
|
||||
2, new Video(2, "Godzilla Resurgence", 120, "Action & drama movie|",
|
||||
"Hideaki Anno", "Japanese"),
|
||||
3, new Video(3, "Interstellar", 169, "Adventure & Sci-Fi",
|
||||
"Christopher Nolan", "English"));
|
||||
VideoResource videoResource = new VideoResource(new FieldJsonMapper(), videos);
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user