Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document Java Any exemplar APIs. #163

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions content/reference/java/java-generated.md
Original file line number Diff line number Diff line change
Expand Up @@ -675,10 +675,19 @@ class Any {
// Checks whether this Any message’s payload is the given type.
public <T extends Message> boolean is(class<T> clazz);

// Checks whether this Any message’s payload has the same type as the given
// message.
public boolean isSameTypeAs(Message message);

// Unpacks Any into the given message type. Throws exception if
// the type doesn’t match or parsing the payload has failed.
public <T extends Message> T unpack(class<T> clazz)
throws InvalidProtocolBufferException;

// Unpacks Any into a message with the same type as the given messsage.
// Throws exception if the type doesn’t match or parsing the payload fails.
public <T extends Message> T unpackSameTypeAs(T message)
throws InvalidProtocolBufferException;
}
```

Expand Down