public VideoSnippet addTags(Collection<? extends String> tags) { VideoSnippet mSnippet = mVideo.getSnippet(); List<String> mTags = mSnippet.getTags(); if (mTags == null) { mTags = new ArrayList<String>(2); } mTags.addAll(tags); return mSnippet; }
private void prepareYElementFromApi(Video video, YElement yElement) throws ParseException { yElement.addName(new YName(video.getSnippet().getTitle())); yElement.addDescription(new YDescription(YLanguage.Undetermined, video.getSnippet().getDescription() , DescriptionTypes.DS_SUMMARY)); prepareDate(video, yElement); String license = video.getStatus().getLicense(); if(null != license && license.contains("creativeCommon")) { yElement.addTagList(new YTagList().setType(YModelUtils.LICENSE).addValue("cc0")); } prepareContent(video, yElement); List<String> tags = video.getSnippet().getTags(); if (CollectionUtils.isNotEmpty(tags)) { yElement.addTagList(new YTagList().setType(TagTypes.TG_KEYWORD).setValues(tags)); } YCurrent currentLevel = new YCurrent().setLevel(VideoConstants.VIDEO_CURRENT_LEVEL); yElement.addStructure(new YStructure() .setHierarchy(HierarchyWithLevelIds.EXT_HIERARCHY_PUBLICATION) .setCurrent(currentLevel)); prepareAttributes(video, yElement); }