Skip to content

Commit

Permalink
Update use of term Any to Document
Browse files Browse the repository at this point in the history
  • Loading branch information
gosar committed Apr 11, 2024
1 parent 106137c commit b980b0f
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public void streamingRequestPayload() {
}

@Test
public void testAny() {
public void testDocument() {
Codec codec = JsonCodec.builder().useJsonName(true).useTimestampFormat(true).build();

PutPersonInput input = PutPersonInput.builder()
Expand All @@ -99,12 +99,12 @@ public void testAny() {
// Serialize directly to JSON.
System.out.println(codec.serializeToString(input));

// Convert to an Any and then serialize to JSON.
Document any = Document.ofStruct(input);
System.out.println(codec.serializeToString(any));
// Convert to a Document and then serialize to JSON.
Document document = Document.ofStruct(input);
System.out.println(codec.serializeToString(document));

// Send the Any to a person builder.
PutPersonInput inputCopy = any.asShape(PutPersonInput.builder());
// Send the Document to a person builder.
PutPersonInput inputCopy = document.asShape(PutPersonInput.builder());

// Now serialize that to see that it round-trips.
System.out.println(codec.serializeToString(inputCopy));
Expand Down

0 comments on commit b980b0f

Please sign in to comment.