/** * Given the raw JsonNode, construct a video snippet object. * @param node JsonNode * @return VideoSnippet */ private VideoSnippet buildSnippet(JsonNode node) { VideoSnippet snippet = new VideoSnippet(); JsonNode snippetNode = node.get("snippet"); snippet.setChannelId(snippetNode.get("channelId").asText()); snippet.setChannelTitle(snippetNode.get("channelTitle").asText()); snippet.setDescription(snippetNode.get("description").asText()); snippet.setTitle(snippetNode.get("title").asText()); snippet.setPublishedAt(new DateTime(snippetNode.get("publishedAt").get("value").asLong())); ThumbnailDetails thumbnailDetails = new ThumbnailDetails(); for (JsonNode t : snippetNode.get("thumbnails")) { Thumbnail thumbnail = new Thumbnail(); thumbnail.setHeight(t.get("height").asLong()); thumbnail.setUrl(t.get("url").asText()); thumbnail.setWidth(t.get("width").asLong()); thumbnailDetails.setDefault(thumbnail); } snippet.setThumbnails(thumbnailDetails); return snippet; }