public static SnapshotsStreamIdxRowResult of(RowResult<byte[]> rowResult) { SnapshotsStreamIdxRow rowName = SnapshotsStreamIdxRow.BYTES_HYDRATOR.hydrateFromBytes(rowResult.getRowName()); Set<SnapshotsStreamIdxColumnValue> columnValues = Sets.newHashSetWithExpectedSize(rowResult.getColumns().size()); for (Entry<byte[], byte[]> e : rowResult.getColumns().entrySet()) { SnapshotsStreamIdxColumn col = SnapshotsStreamIdxColumn.BYTES_HYDRATOR.hydrateFromBytes(e.getKey()); Long value = SnapshotsStreamIdxColumnValue.hydrateValue(e.getValue()); columnValues.add(SnapshotsStreamIdxColumnValue.of(col, value)); } return new SnapshotsStreamIdxRowResult(rowName, ImmutableSet.copyOf(columnValues)); }
public static SnapshotsStreamIdxRowResult of(RowResult<byte[]> rowResult) { SnapshotsStreamIdxRow rowName = SnapshotsStreamIdxRow.BYTES_HYDRATOR.hydrateFromBytes(rowResult.getRowName()); Set<SnapshotsStreamIdxColumnValue> columnValues = Sets.newHashSetWithExpectedSize(rowResult.getColumns().size()); for (Entry<byte[], byte[]> e : rowResult.getColumns().entrySet()) { SnapshotsStreamIdxColumn col = SnapshotsStreamIdxColumn.BYTES_HYDRATOR.hydrateFromBytes(e.getKey()); Long value = SnapshotsStreamIdxColumnValue.hydrateValue(e.getValue()); columnValues.add(SnapshotsStreamIdxColumnValue.of(col, value)); } return new SnapshotsStreamIdxRowResult(rowName, ImmutableSet.copyOf(columnValues)); }