@Test public void serializeTest() { final MergeParentMetadata merge = new MergeParentMetadata.Builder() .setRyaInstanceName(TEST_INSTANCE) .setTimestamp(TEST_TIMESTAMP) .setFilterTimestmap(TEST_FILTER_TIMESTAMP) .setParentTimeOffset(TEST_TIME_OFFSET) .build(); final Document expected = new Document() .append(RYANAME_KEY, TEST_INSTANCE) .append(TIMESTAMP_KEY, TEST_TIMESTAMP) .append(FILTER_TIMESTAMP_KEY, TEST_FILTER_TIMESTAMP) .append(PARENT_TIME_OFFSET_KEY, TEST_TIME_OFFSET); final Document actual = adapter.serialize(merge); assertEquals(expected, actual); }
public Document serialize(final MergeParentMetadata metadata) { final Document doc = new Document() .append(RYANAME_KEY, metadata.getRyaInstanceName()) .append(TIMESTAMP_KEY, metadata.getTimestamp()) .append(FILTER_TIMESTAMP_KEY, metadata.getFilterTimestamp()) .append(PARENT_TIME_OFFSET_KEY, metadata.getParentTimeOffset()); return doc; }
ParentMetadataRepositoryAdapter { public Document serialize(final MergeParentMetadata metadata) { final Document doc = new Document() .append(RYANAME_KEY, metadata.getRyaInstanceName()) .append(TIMESTAMP_KEY, metadata.getTimestamp()) .append(FILTER_TIMESTAMP_KEY, metadata.getFilterTimestamp()) .append(PARENT_TIME_OFFSET_KEY, metadata.getParentTimeOffset()); return doc; } }
ParentMetadataRepositoryAdapter { public Document serialize(final MergeParentMetadata metadata) { final Document doc = new Document() .append(RYANAME_KEY, metadata.getRyaInstanceName()) .append(TIMESTAMP_KEY, metadata.getTimestamp()) .append(FILTER_TIMESTAMP_KEY, metadata.getFilterTimestamp()) .append(PARENT_TIME_OFFSET_KEY, metadata.getParentTimeOffset()); return doc; }  }
ParentMetadataRepositoryAdapter { public Document serialize(final MergeParentMetadata metadata) { final Document doc = new Document() .append(RYANAME_KEY, metadata.getRyaInstanceName()) .append(TIMESTAMP_KEY, metadata.getTimestamp()) .append(FILTER_TIMESTAMP_KEY, metadata.getFilterTimestamp()) .append(PARENT_TIME_OFFSET_KEY, metadata.getParentTimeOffset()); return doc; }  Document serialize(final MergeParentMetadata metadata); MergeParentMetadata deserialize(final Document doc); }
ParentMetadataRepositoryAdapter { public Document serialize(final MergeParentMetadata metadata) { final Document doc = new Document() .append(RYANAME_KEY, metadata.getRyaInstanceName()) .append(TIMESTAMP_KEY, metadata.getTimestamp()) .append(FILTER_TIMESTAMP_KEY, metadata.getFilterTimestamp()) .append(PARENT_TIME_OFFSET_KEY, metadata.getParentTimeOffset()); return doc; }  Document serialize(final MergeParentMetadata metadata); MergeParentMetadata deserialize(final Document doc); static final String RYANAME_KEY; static final String TIMESTAMP_KEY; static final String FILTER_TIMESTAMP_KEY; static final String PARENT_TIME_OFFSET_KEY; }