@Test public void serialization() { SnapshotMetadata metadata = new SnapshotMetadata(Instant.ofEpochMilli(758949005001L), new SnapshotId("blah")); JsonNode jsonNode = BatfishObjectMapper.mapper().valueToTree(metadata); assertThat(jsonNode.get(PROP_CREATION_TIMESTAMP).asText(), equalTo("1994-01-19T03:10:05.001Z")); assertThat(jsonNode.get(PROP_PARENT_SNAPSHOT_ID).asText(), equalTo("blah")); assertThat( jsonNode.get(PROP_INITIALIZATION_METADATA).get("currentStatus").asText(), equalTo(ProcessingStatus.UNINITIALIZED.toString())); }
@Override public @Nonnull String toString() { return toStringHelper(getClass()) .omitNullValues() .add(PROP_CREATION_TIMESTAMP, _creationTimestamp) .add(PROP_INITIALIZATION_METADATA, _initializationMetadata) .add(PROP_PARENT_SNAPSHOT_ID, _parentSnapshotId) .toString(); }
SnapshotMetadata { @Override public @Nonnull String toString() { return toStringHelper(getClass()) .omitNullValues() .add(PROP_CREATION_TIMESTAMP, _creationTimestamp) .add(PROP_INITIALIZATION_METADATA, _initializationMetadata) .add(PROP_PARENT_SNAPSHOT_ID, _parentSnapshotId) .toString(); } }
SnapshotMetadata { @Override public @Nonnull String toString() { return toStringHelper(getClass()) .omitNullValues() .add(PROP_CREATION_TIMESTAMP, _creationTimestamp) .add(PROP_INITIALIZATION_METADATA, _initializationMetadata) .add(PROP_PARENT_SNAPSHOT_ID, _parentSnapshotId) .toString(); } SnapshotMetadata(
      Instant creationTimestamp,
      InitializationMetadata initializationMetadata,
      @Nullable SnapshotId parentSnapshot);  SnapshotMetadata(Instant creationTimestamp, @Nullable SnapshotId parentSnapshotId); }
SnapshotMetadata { @Override public @Nonnull String toString() { return toStringHelper(getClass()) .omitNullValues() .add(PROP_CREATION_TIMESTAMP, _creationTimestamp) .add(PROP_INITIALIZATION_METADATA, _initializationMetadata) .add(PROP_PARENT_SNAPSHOT_ID, _parentSnapshotId) .toString(); } SnapshotMetadata(
      Instant creationTimestamp,
      InitializationMetadata initializationMetadata,
      @Nullable SnapshotId parentSnapshot);  SnapshotMetadata(Instant creationTimestamp, @Nullable SnapshotId parentSnapshotId); @Override boolean equals(@Nullable Object obj); @JsonProperty(PROP_CREATION_TIMESTAMP) @Nonnull Instant getCreationTimestamp(); @JsonProperty(PROP_INITIALIZATION_METADATA) @Nonnull InitializationMetadata getInitializationMetadata(); @JsonProperty(PROP_PARENT_SNAPSHOT_ID) @Nullable SnapshotId getParentSnapshotId(); @Override int hashCode(); @Override @Nonnull String toString(); @Nonnull SnapshotMetadata updateStatus(
      ProcessingStatus status, @Nullable String errMessage); }
SnapshotMetadata { @Override public @Nonnull String toString() { return toStringHelper(getClass()) .omitNullValues() .add(PROP_CREATION_TIMESTAMP, _creationTimestamp) .add(PROP_INITIALIZATION_METADATA, _initializationMetadata) .add(PROP_PARENT_SNAPSHOT_ID, _parentSnapshotId) .toString(); } SnapshotMetadata(
      Instant creationTimestamp,
      InitializationMetadata initializationMetadata,
      @Nullable SnapshotId parentSnapshot);  SnapshotMetadata(Instant creationTimestamp, @Nullable SnapshotId parentSnapshotId); @Override boolean equals(@Nullable Object obj); @JsonProperty(PROP_CREATION_TIMESTAMP) @Nonnull Instant getCreationTimestamp(); @JsonProperty(PROP_INITIALIZATION_METADATA) @Nonnull InitializationMetadata getInitializationMetadata(); @JsonProperty(PROP_PARENT_SNAPSHOT_ID) @Nullable SnapshotId getParentSnapshotId(); @Override int hashCode(); @Override @Nonnull String toString(); @Nonnull SnapshotMetadata updateStatus(
      ProcessingStatus status, @Nullable String errMessage);  }