@Override protected void writeSimpleResult(final PrintStream output) { if (versions == null || versions.isEmpty()) { return; } // date length, with locale specifics final String datePattern = "%1$ta, %<tb %<td %<tY %<tR %<tZ"; final int dateLength = String.format(datePattern, new Date()).length(); final Table table = new Table.Builder() .column("Ver", 3, 3, false) .column("Date", dateLength, dateLength, false) .column("Author", 20, 200, true) .column("Message", 8, 40, true) .build(); versions.forEach(vfs -> { table.addRow( String.valueOf(vfs.getVersion()), String.format(datePattern, new Date(vfs.getTimestamp())), vfs.getAuthor(), vfs.getComments() ); }); final TableWriter tableWriter = new DynamicTableWriter(); tableWriter.write(table, output); } }
public static FlowSnapshotEntity map(final VersionedFlowSnapshotMetadata versionedFlowSnapshot) { final FlowSnapshotEntity flowSnapshotEntity = new FlowSnapshotEntity(); flowSnapshotEntity.setFlowId(versionedFlowSnapshot.getFlowIdentifier()); flowSnapshotEntity.setVersion(versionedFlowSnapshot.getVersion()); flowSnapshotEntity.setComments(versionedFlowSnapshot.getComments()); flowSnapshotEntity.setCreated(new Date(versionedFlowSnapshot.getTimestamp())); flowSnapshotEntity.setCreatedBy(versionedFlowSnapshot.getAuthor()); return flowSnapshotEntity; }
public Builder(final Bucket bucket, final VersionedFlow versionedFlow, final VersionedFlowSnapshotMetadata snapshotMetadata) { bucketId(bucket.getIdentifier()); bucketName(bucket.getName()); flowId(snapshotMetadata.getFlowIdentifier()); flowName(versionedFlow.getName()); version(snapshotMetadata.getVersion()); comments(snapshotMetadata.getComments()); author(snapshotMetadata.getAuthor()); snapshotTimestamp(snapshotMetadata.getTimestamp()); }