public CategoryImpl(Category category) { this.name = category.getName(); this.uuid = category.getUUID(); this.iconCSSStyle = category.getIconCSSStyle(); this.previewCSSStyleName = category.getPreviewCSSStyleName(); this.readonlyCSSStyleName = category.getReadonlyCSSStyleName(); }
public CategoryImpl(Category category) { this.name = category.getName(); this.uuid = category.getUUID(); this.iconCSSStyle = category.getIconCSSStyle(); this.previewCSSStyleName = category.getPreviewCSSStyleName(); this.readonlyCSSStyleName = category.getReadonlyCSSStyleName(); }
@Override public Category updateCategoryByUUID(final String uuid, final String name, final String iconCSSStyle, final String previewCSSStyleName, final String cssStyleName) throws CategoryNotFoundException, CategoryAlreadyExistsException { FacadeUtil.checkArgsNotNull(uuid, name); final CategoryImpl category = EnvTool.getJournalQueriers().getCategoryByUUID(uuid); if (category == null) { throw new CategoryNotFoundException(name); } final Set<Category> categories = EnvTool.getJournalQueriers().getCategories(Arrays.asList(name)); if (categories != null && !categories.isEmpty()) { if (!categories.iterator().next().getUUID().equals(uuid)) { throw new CategoryAlreadyExistsException(name); } } category.setIconCSSStyle(iconCSSStyle); category.setPreviewCSSStyleName(previewCSSStyleName); category.setReadonlyCSSStyleName(cssStyleName); category.setName(name); return new CategoryImpl(category); }