CategoryOption extends BaseDimensionalItemObject implements SystemDefaultMetadataObject { @JsonProperty( "isDefault" ) @Override public boolean isDefault() { return DEFAULT_NAME.equals( name ); } CategoryOption();  CategoryOption( String name ); @JsonProperty( "isDefault" ) @Override boolean isDefault(); Set<CategoryOptionGroupSet> getGroupSets(); void addCategoryOptionCombo( CategoryOptionCombo dataElementCategoryOptionCombo ); void removeCategoryOptionCombo( CategoryOptionCombo dataElementCategoryOptionCombo ); void addOrganisationUnit( OrganisationUnit organisationUnit ); void removeOrganisationUnit( OrganisationUnit organisationUnit ); boolean includes( OrganisationUnit ou ); boolean includesAny( Set<OrganisationUnit> orgUnits ); Date getAdjustedEndDate( DataSet dataSet ); Date getAdjustedEndDate( DataElement dataElement ); Date getAdjustedEndDate( DataSet dataSet, DataElement dataElement ); @Override DimensionItemType getDimensionItemType(); @JsonProperty @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 ) Date getStartDate(); void setStartDate( Date startDate ); @JsonProperty @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 ) Date getEndDate(); void setEndDate( Date endDate ); @JsonProperty @JsonSerialize( contentAs = BaseIdentifiableObject.class ) @JacksonXmlElementWrapper( localName = "organisationUnits", namespace = DxfNamespaces.DXF_2_0 ) @JacksonXmlProperty( localName = "organisationUnit", namespace = DxfNamespaces.DXF_2_0 ) Set<OrganisationUnit> getOrganisationUnits(); void setOrganisationUnits( Set<OrganisationUnit> organisationUnits ); @JsonProperty @JsonSerialize( contentAs = BaseIdentifiableObject.class ) @JacksonXmlElementWrapper( localName = "categories", namespace = DxfNamespaces.DXF_2_0 ) @JacksonXmlProperty( localName = "category", namespace = DxfNamespaces.DXF_2_0 ) Set<Category> getCategories(); void setCategories( Set<Category> categories ); @JsonProperty @JsonSerialize( contentAs = BaseIdentifiableObject.class ) @JacksonXmlElementWrapper( localName = "categoryOptionCombos", namespace = DxfNamespaces.DXF_2_0 ) @JacksonXmlProperty( localName = "categoryOptionCombo", namespace = DxfNamespaces.DXF_2_0 ) Set<CategoryOptionCombo> getCategoryOptionCombos(); void setCategoryOptionCombos( Set<CategoryOptionCombo> categoryOptionCombos ); @JsonProperty @JsonSerialize( contentAs = BaseIdentifiableObject.class ) @JacksonXmlElementWrapper( localName = "categoryOptionGroups", namespace = DxfNamespaces.DXF_2_0 ) @JacksonXmlProperty( localName = "categoryOptionGroup", namespace = DxfNamespaces.DXF_2_0 ) Set<CategoryOptionGroup> getGroups(); void setGroups( Set<CategoryOptionGroup> groups ); @JsonProperty @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 ) ObjectStyle getStyle(); void setStyle( ObjectStyle style ); @JsonProperty @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 ) @PropertyRange( min = 2 ) String getFormName(); void setFormName( String formName ); String getFormNameFallback(); @JsonProperty @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 ) String getDisplayFormName(); void setDisplayFormName( String displayFormName ); static final String DEFAULT_NAME; }
@Test public void isDefault() { CategoryOption categoryOption = new CategoryOption(); categoryOption.setName( CategoryOption.DEFAULT_NAME ); Assert.assertTrue( categoryOption.isDefault() ); }
@Test public void isNotDefault() { CategoryOption categoryOption = new CategoryOption(); categoryOption.setName( CategoryOption.DEFAULT_NAME + "x" ); Assert.assertFalse( categoryOption.isDefault() ); }