diff --git a/content/reference/java/java-generated.md b/content/reference/java/java-generated.md index b30d50cb..39984072 100644 --- a/content/reference/java/java-generated.md +++ b/content/reference/java/java-generated.md @@ -675,10 +675,19 @@ class Any { // Checks whether this Any message’s payload is the given type. public boolean is(class 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 unpack(class 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 unpackSameTypeAs(T message) + throws InvalidProtocolBufferException; } ```