@Override protected void writeSimpleResult(final PrintStream output) { final Table table = new Table.Builder() .column("#", 3, 3, false) .column("Name", 20, 36, true) .column("Id", 36, 36, false) .column("Running", 7, 7, false) .column("Stopped", 7, 7, false) .column("Disabled", 8, 8, false) .column("Invalid", 7, 7, false) .build(); for (int i=0; i < processGroups.size(); i++) { final ProcessGroupDTO dto = processGroups.get(i); table.addRow( String.valueOf(i+1), dto.getName(), dto.getId(), String.valueOf(dto.getRunningCount()), String.valueOf(dto.getStoppedCount()), String.valueOf(dto.getDisabledCount()), String.valueOf(dto.getInvalidCount()) ); } final TableWriter tableWriter = new DynamicTableWriter(); tableWriter.write(table, output); }
public ProcessGroupDTO copy(final ProcessGroupDTO original, final boolean deep) { final ProcessGroupDTO copy = new ProcessGroupDTO(); copy.setComments(original.getComments()); copy.setContents(copy(original.getContents(), deep)); copy.setPosition(original.getPosition()); copy.setId(original.getId()); copy.setInputPortCount(original.getInputPortCount()); copy.setInvalidCount(original.getInvalidCount()); copy.setName(original.getName()); copy.setVersionControlInformation(copy(original.getVersionControlInformation())); copy.setOutputPortCount(original.getOutputPortCount()); copy.setParentGroupId(original.getParentGroupId()); copy.setVersionedComponentId(original.getVersionedComponentId()); copy.setRunningCount(original.getRunningCount()); copy.setStoppedCount(original.getStoppedCount()); copy.setDisabledCount(original.getDisabledCount()); copy.setActiveRemotePortCount(original.getActiveRemotePortCount()); copy.setInactiveRemotePortCount(original.getInactiveRemotePortCount()); copy.setUpToDateCount(original.getUpToDateCount()); copy.setLocallyModifiedCount(original.getLocallyModifiedCount()); copy.setStaleCount(original.getStaleCount()); copy.setLocallyModifiedAndStaleCount(original.getLocallyModifiedAndStaleCount()); copy.setSyncFailureCount(original.getSyncFailureCount()); if (original.getVariables() != null) { copy.setVariables(new HashMap<>(original.getVariables())); } return copy; }
entity.setRunningCount(dto.getRunningCount()); entity.setStoppedCount(dto.getStoppedCount()); entity.setInvalidCount(dto.getInvalidCount()); entity.setDisabledCount(dto.getDisabledCount()); entity.setActiveRemotePortCount(dto.getActiveRemotePortCount());