Category extends BaseDimensionalObject implements SystemDefaultMetadataObject { @Override public boolean isDefault() { return DEFAULT_NAME.equals( name ); } Category();  Category( String name, DataDimensionType dataDimensionType );  Category( String name, DataDimensionType dataDimensionType, List<CategoryOption> categoryOptions ); void addCategoryOption( CategoryOption categoryOption ); void removeCategoryOption( CategoryOption categoryOption ); void removeAllCategoryOptions(); void addCategoryCombo( CategoryCombo categoryCombo ); void removeCategoryCombo( CategoryCombo categoryCombo ); void removeAllCategoryCombos(); CategoryOption getCategoryOption( CategoryOptionCombo categoryOptionCombo ); @Override boolean isDefault(); @Override @JsonProperty @JsonSerialize( contentAs = BaseDimensionalItemObject.class ) @JacksonXmlElementWrapper( localName = "items", namespace = DxfNamespaces.DXF_2_0 ) @JacksonXmlProperty( localName = "item", namespace = DxfNamespaces.DXF_2_0 ) List<DimensionalItemObject> getItems(); @Override DimensionType getDimensionType(); @Override String getShortName(); @JsonProperty @JsonSerialize( contentAs = BaseIdentifiableObject.class ) @JacksonXmlElementWrapper( localName = "categoryOptions", namespace = DxfNamespaces.DXF_2_0 ) @JacksonXmlProperty( localName = "categoryOption", namespace = DxfNamespaces.DXF_2_0 ) List<CategoryOption> getCategoryOptions(); void setCategoryOptions( List<CategoryOption> categoryOptions ); @JsonProperty @JsonSerialize( contentAs = BaseIdentifiableObject.class ) @JacksonXmlElementWrapper( localName = "categoryCombos", namespace = DxfNamespaces.DXF_2_0 ) @JacksonXmlProperty( localName = "categoryCombo", namespace = DxfNamespaces.DXF_2_0 ) List<CategoryCombo> getCategoryCombos(); void setCategoryCombos( List<CategoryCombo> categoryCombos ); static final String DEFAULT_NAME; }
@Test public void isDefault() { Category category = new Category(); category.setName( Category.DEFAULT_NAME ); Assert.assertTrue( category.isDefault() ); }
@Test public void isNotDefault() { Category category = new Category(); category.setName( Category.DEFAULT_NAME + "x" ); Assert.assertFalse( category.isDefault() ); }