DataSet extends BaseDimensionalItemObject implements VersionedObject, MetadataObject, InterpretableObject { public boolean addDataSetElement( DataSetElement element ) { element.getDataElement().getDataSetElements().add( element ); return dataSetElements.add( element ); } DataSet();  DataSet( String name );  DataSet( String name, PeriodType periodType );  DataSet( String name, String shortName, PeriodType periodType );  DataSet( String name, String shortName, String code, PeriodType periodType ); void addOrganisationUnit( OrganisationUnit organisationUnit ); boolean removeOrganisationUnit( OrganisationUnit organisationUnit ); void removeAllOrganisationUnits(); void updateOrganisationUnits( Set<OrganisationUnit> updates ); boolean hasOrganisationUnit( OrganisationUnit unit ); boolean addDataInputPeriod( DataInputPeriod dataInputPeriod ); boolean addDataSetElement( DataSetElement element ); boolean addDataSetElement( DataElement dataElement ); boolean addDataSetElement( DataElement dataElement, CategoryCombo categoryCombo ); boolean removeDataSetElement( DataSetElement element ); void removeDataSetElement( DataElement dataElement ); void removeAllDataSetElements(); void addIndicator( Indicator indicator ); boolean removeIndicator( Indicator indicator ); void addCompulsoryDataElementOperand( DataElementOperand dataElementOperand ); void removeCompulsoryDataElementOperand( DataElementOperand dataElementOperand ); void assignWorkflow( DataApprovalWorkflow workflow ); boolean hasDataEntryForm(); boolean hasSections(); boolean isApproveData(); @JsonProperty @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 ) FormType getFormType(); Set<DataElement> getDataElements(); Set<DataElement> getDataElementsInSections(); Set<CategoryOptionCombo> getDataElementOptionCombos(); @Override int increaseVersion(); Set<CategoryOptionGroupSet> getCategoryOptionGroupSets(); boolean hasCategoryCombo(); boolean isLocked( User user, Period period, Date now ); boolean isDataInputPeriodAndDateAllowed( Period period, Date date ); @Override DimensionItemType getDimensionItemType(); @JsonProperty @JsonSerialize( using = JacksonPeriodTypeSerializer.class ) @JsonDeserialize( using = JacksonPeriodTypeDeserializer.class ) @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 ) @Property( PropertyType.TEXT ) PeriodType getPeriodType(); void setPeriodType( PeriodType periodType ); @JsonProperty @JacksonXmlElementWrapper( localName = "dataInputPeriods", namespace = DxfNamespaces.DXF_2_0 ) @JacksonXmlProperty( localName = "dataInputPeriods", namespace = DxfNamespaces.DXF_2_0 ) Set<DataInputPeriod> getDataInputPeriods(); void setDataInputPeriods( Set<DataInputPeriod> dataInputPeriods ); @JsonProperty @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 ) DataEntryForm getDataEntryForm(); void setDataEntryForm( DataEntryForm dataEntryForm ); @JsonProperty @JsonSerialize( contentAs = BaseIdentifiableObject.class ) @JacksonXmlElementWrapper( localName = "dataSetElements", namespace = DxfNamespaces.DXF_2_0 ) @JacksonXmlProperty( localName = "dataSetElement", namespace = DxfNamespaces.DXF_2_0 ) Set<DataSetElement> getDataSetElements(); void setDataSetElements( Set<DataSetElement> dataSetElements ); @JsonProperty @JsonSerialize( contentAs = BaseIdentifiableObject.class ) @JacksonXmlElementWrapper( localName = "indicators", namespace = DxfNamespaces.DXF_2_0 ) @JacksonXmlProperty( localName = "indicator", namespace = DxfNamespaces.DXF_2_0 ) Set<Indicator> getIndicators(); void setIndicators( Set<Indicator> indicators ); @JsonProperty @JacksonXmlElementWrapper( localName = "compulsoryDataElementOperands", namespace = DxfNamespaces.DXF_2_0 ) @JacksonXmlProperty( localName = "compulsoryDataElementOperand", namespace = DxfNamespaces.DXF_2_0 ) Set<DataElementOperand> getCompulsoryDataElementOperands(); void setCompulsoryDataElementOperands( Set<DataElementOperand> compulsoryDataElementOperands ); @JsonProperty( value = "organisationUnits" ) @JsonSerialize( contentAs = BaseIdentifiableObject.class ) @JacksonXmlElementWrapper( localName = "organisationUnits", namespace = DxfNamespaces.DXF_2_0 ) @JacksonXmlProperty( localName = "organisationUnit", namespace = DxfNamespaces.DXF_2_0 ) Set<OrganisationUnit> getSources(); void setSources( Set<OrganisationUnit> sources ); @JsonProperty @JsonSerialize( contentAs = BaseIdentifiableObject.class ) @JacksonXmlElementWrapper( localName = "sections", namespace = DxfNamespaces.DXF_2_0 ) @JacksonXmlProperty( localName = "section", namespace = DxfNamespaces.DXF_2_0 ) Set<Section> getSections(); void setSections( Set<Section> sections ); @JsonProperty @JsonSerialize( as = BaseIdentifiableObject.class ) @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 ) CategoryCombo getCategoryCombo(); void setCategoryCombo( CategoryCombo categoryCombo ); @JsonProperty @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 ) boolean isMobile(); void setMobile( boolean mobile ); @Override @JsonProperty @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 ) int getVersion(); @Override void setVersion( int version ); @JsonProperty @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 ) @PropertyRange( min = Integer.MIN_VALUE ) int getExpiryDays(); void setExpiryDays( int expiryDays ); @JsonProperty @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 ) int getTimelyDays(); void setTimelyDays( int timelyDays ); @JsonProperty @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 ) UserGroup getNotificationRecipients(); void setNotificationRecipients( UserGroup notificationRecipients ); @JsonProperty @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 ) boolean isNotifyCompletingUser(); void setNotifyCompletingUser( boolean notifyCompletingUser ); @JsonProperty @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 ) DataApprovalWorkflow getWorkflow(); void setWorkflow( DataApprovalWorkflow workflow ); @Override @JsonProperty @JsonSerialize( contentAs = BaseIdentifiableObject.class ) @JacksonXmlElementWrapper( localName = "interpretations", namespace = DxfNamespaces.DXF_2_0 ) @JacksonXmlProperty( localName = "interpretation", namespace = DxfNamespaces.DXF_2_0 ) Set<Interpretation> getInterpretations(); void setInterpretations( Set<Interpretation> interpretations ); @JsonProperty @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 ) int getOpenFuturePeriods(); void setOpenFuturePeriods( int openFuturePeriods ); @JsonProperty @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 ) int getOpenPeriodsAfterCoEndDate(); void setOpenPeriodsAfterCoEndDate( int openPeriodsAfterCoEndDate ); @JsonProperty @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 ) boolean isFieldCombinationRequired(); void setFieldCombinationRequired( boolean fieldCombinationRequired ); @JsonProperty @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 ) boolean isValidCompleteOnly(); void setValidCompleteOnly( boolean validCompleteOnly ); @JsonProperty @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 ) boolean isNoValueRequiresComment(); void setNoValueRequiresComment( boolean noValueRequiresComment ); @JsonProperty @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 ) boolean isSkipOffline(); void setSkipOffline( boolean skipOffline ); @JsonProperty @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 ) boolean isRenderAsTabs(); void setRenderAsTabs( boolean renderAsTabs ); @JsonProperty @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 ) boolean isRenderHorizontally(); void setRenderHorizontally( boolean renderHorizontally ); @JsonProperty @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 ) boolean isDataElementDecoration(); void setDataElementDecoration( boolean dataElementDecoration ); @JsonProperty @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 ) ObjectStyle getStyle(); void setStyle( ObjectStyle style ); @Override @JsonProperty @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 ) String getFormName(); @Override void setFormName( String formName ); @JsonProperty @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 ) boolean isCompulsoryFieldsCompleteOnly(); void setCompulsoryFieldsCompleteOnly( boolean compulsoryFieldsCompleteOnly ); static final int NO_EXPIRY; }
@Test public void testAddDataSetElement() { DataSet dsA = new DataSet( "DataSetA" ); DataSet dsB = new DataSet( "DataSetB" ); DataElement deA = new DataElement( "DataElementA" ); DataElement deB = new DataElement( "DataElementB" ); dsA.addDataSetElement( deA ); dsA.addDataSetElement( deB ); dsB.addDataSetElement( deA ); assertEquals( 2, dsA.getDataSetElements().size() ); assertEquals( 1, dsB.getDataSetElements().size() ); assertEquals( 2, deA.getDataSetElements().size() ); assertEquals( 1, deB.getDataSetElements().size() ); }