com.google.protobufI found the interface in the package Message, it claims that it will compare by content:
public interface Message extends MessageLite, MessageOrBuilder {
@Override
boolean equals(Object other);
But I am writing test code:
public class Test {
public static void main(String args[]) {
UserMidMessage.UserMid.Builder aBuilder = UserMidMessage.UserMid.newBuilder();
aBuilder.setQuery("aaa");
aBuilder.setCateId("bbb");
aBuilder.setType(UserMidMessage.Type.BROWSE);
System.out.println(aBuilder.build() == aBuilder.build());
}
}
He gives false.
So, how to compare with the proto-buffer message?
source
share