Advertisement
Guest User

Untitled

a guest
May 6th, 2015
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. import com.fasterxml.jackson.annotation.JsonCreator;
  2. import test.protobuf.Test;
  3.  
  4. public class Wrapper {
  5. public Test.Foo foo;
  6.  
  7. @JsonCreator
  8. public Wrapper(Test.Foo foo) {
  9. this.foo = foo;
  10. }
  11.  
  12. public Wrapper() {
  13. this(null);
  14. }
  15.  
  16. @Override
  17. public boolean equals(Object other) {
  18. if (this == other) return true;
  19. if ( !(other instanceof Wrapper)) return false;
  20. final Wrapper wrapper = (Wrapper) other;
  21. if (foo == null) return wrapper.foo == null;
  22. return wrapper.foo.equals(foo);
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement