mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-10-12 02:14:07 +00:00
#631 - Partial Response : Return video details as json string.
This commit is contained in:
1 parent
b7dbb4049c
commit
a0c081f5ea
3 files changed
+24
-21
No files matched your search
@@ -27,13 +27,13 @@ package com.iluwatar.partialresponse;
|
||||
import java.util.Map;
|
||||
|
||||
public class VideoResource {
|
||||
private Map<String, Video> videos;
|
||||
private Map<Integer, Video> videos;
|
||||
|
||||
public VideoResource(Map<String, Video> videos) {
|
||||
public VideoResource(Map<Integer, Video> videos) {
|
||||
this.videos = videos;
|
||||
}
|
||||
|
||||
public String getDetails(String id) {
|
||||
public String getDetails(Integer id) {
|
||||
return videos.get(id).toString();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user