ImportSummaries extends AbstractWebMessageResponse { public ImportSummaries addImportSummary( ImportSummary importSummary ) { if ( importSummary == null ) { return this; } if ( importSummary.getImportCount() != null ) { imported += importSummary.getImportCount().getImported(); updated += importSummary.getImportCount().getUpdated(); deleted += importSummary.getImportCount().getDeleted(); ignored += importSummary.getImportCount().getIgnored(); } importSummaries.add( importSummary ); status = getHighestOrderImportStatus(); return this; } ImportSummaries(); void addImportSummaries( ImportSummaries importSummaries ); void addImportSummaries( List<ImportSummary> importSummaries ); ImportSummaries addImportSummary( ImportSummary importSummary ); String toCountString(); boolean isStatus( ImportStatus status ); boolean hasConflicts(); Optional<ImportSummary> getByReference( String reference ); ImportStatus getHighestOrderImportStatus(); @JsonProperty @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 ) ImportStatus getStatus(); void setStatus( ImportStatus status ); @JsonProperty @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 ) int getImported(); @JsonProperty @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 ) int getUpdated(); @JsonProperty @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 ) int getDeleted(); @JsonProperty @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 ) int getIgnored(); @JsonProperty @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 ) int getTotal(); void setTotal( int total ); @JsonProperty @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 ) ImportOptions getImportOptions(); void setImportOptions( ImportOptions importOptions ); @JsonProperty @JacksonXmlElementWrapper( localName = "importSummaryList", namespace = DxfNamespaces.DXF_2_0 ) @JacksonXmlProperty( localName = "importSummary", namespace = DxfNamespaces.DXF_2_0 ) List<ImportSummary> getImportSummaries(); void setImportSummaries( List<ImportSummary> importSummaries ); String toMinimalString(); @Override String toString();  }
@Test public void testAddImportSummary() { ImportSummaries summaries = new ImportSummaries(); summaries.addImportSummary( new ImportSummary( ImportStatus.SUCCESS, "Great success", new ImportCount( 4, 2, 1, 2 ) ) ); summaries.addImportSummary( new ImportSummary( ImportStatus.WARNING, "Ouch warning", new ImportCount( 1, 2, 3, 0 ) ) ); summaries.addImportSummary( new ImportSummary( ImportStatus.SUCCESS, "Great failure", new ImportCount( 0, 0, 4, 3 ) ) ); assertEquals( 5, summaries.getImported() ); assertEquals( 4, summaries.getUpdated() ); assertEquals( 8, summaries.getIgnored() ); assertEquals( 5, summaries.getDeleted() ); }