CategoryOptionCombo extends BaseDimensionalItemObject implements SystemDefaultMetadataObject { public DateRange getDateRange( DataSet dataSet ) { return getDateRange( dataSet, null ); } CategoryOptionCombo(); @Override int hashCode(); @Override boolean equals( Object object ); @Override String toString(); int hashCodeIdentifiableObject(); boolean equalsIdentifiableObject( Object object ); void addCategoryOption( CategoryOption dataElementCategoryOption ); void removeCategoryOption( CategoryOption dataElementCategoryOption ); void removeAllCategoryOptions(); @Override boolean isDefault(); DateRange getDateRange( DataSet dataSet ); DateRange getDateRange( DataElement dataElement ); Set<OrganisationUnit> getOrganisationUnits(); Date getLatestStartDate(); Date getEarliestEndDate(); @Override String getName(); @Override void setName( String name ); @Override @JsonIgnore String getShortName(); @Override void setShortName( String shortName ); @JsonProperty @JsonSerialize( as = BaseIdentifiableObject.class ) @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 ) CategoryCombo getCategoryCombo(); void setCategoryCombo( CategoryCombo categoryCombo ); @JsonProperty @JsonSerialize( contentAs = BaseIdentifiableObject.class ) @JacksonXmlElementWrapper( localName = "categoryOptions", namespace = DxfNamespaces.DXF_2_0 ) @JacksonXmlProperty( localName = "categoryOption", namespace = DxfNamespaces.DXF_2_0 ) Set<CategoryOption> getCategoryOptions(); void setCategoryOptions( Set<CategoryOption> categoryOptions ); @JsonProperty @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 ) boolean isIgnoreApproval(); void setIgnoreApproval( boolean ignoreApproval ); static final String DEFAULT_NAME; static final String DEFAULT_TOSTRING; }
@Test public void testGetDateRangeDataSet() { DateRange dateRange; dateRange = optionComboA.getDateRange( dataSetA ); assertNull( dateRange.getStartDate() ); assertNull( dateRange.getEndDate() ); dateRange = optionComboB.getDateRange( dataSetA ); assertEquals( jan1, dateRange.getStartDate() ); assertEquals( jan4, dateRange.getEndDate() ); dateRange = optionComboB.getDateRange( dataSetB ); assertEquals( jan1, dateRange.getStartDate() ); assertEquals( jan5, dateRange.getEndDate() ); dateRange = optionComboB.getDateRange( dataSetC ); assertEquals( jan1, dateRange.getStartDate() ); assertEquals( jan6, dateRange.getEndDate() ); dateRange = optionComboC.getDateRange( dataSetA ); assertEquals( jan2, dateRange.getStartDate() ); assertEquals( jan4, dateRange.getEndDate() ); dateRange = optionComboC.getDateRange( dataSetB ); assertEquals( jan2, dateRange.getStartDate() ); assertEquals( jan5, dateRange.getEndDate() ); dateRange = optionComboC.getDateRange( dataSetC ); assertEquals( jan2, dateRange.getStartDate() ); assertEquals( jan6, dateRange.getEndDate() ); }
@Test public void testGetDateRangeDataElement() { DateRange dateRange; dateRange = optionComboA.getDateRange( dataElement ); assertNull( dateRange.getStartDate() ); assertNull( dateRange.getEndDate() ); dateRange = optionComboB.getDateRange( dataElement ); assertEquals( jan1, dateRange.getStartDate() ); assertEquals( jan6, dateRange.getEndDate() ); dateRange = optionComboC.getDateRange( dataElement ); assertEquals( jan2, dateRange.getStartDate() ); assertEquals( jan6, dateRange.getEndDate() ); }