public CategoryNotFoundException(CategoryNotFoundException e) { super(e.getMessage()); this.name = e.getName(); }
@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); }
public CategoryNotFoundException(CategoryNotFoundException e) { super(e.getMessage()); this.name = e.getName(); }