Mercurial > hg > Members > sugi > MessagePack-java
comparison src/test/java/org/msgpack/testclasses/InheritanceClass.java @ 0:cb825acd883a
first commit
author | sugi |
---|---|
date | Sat, 18 Oct 2014 15:06:15 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:cb825acd883a |
---|---|
1 package org.msgpack.testclasses; | |
2 | |
3 import org.junit.Ignore; | |
4 import org.msgpack.annotation.Beans; | |
5 import org.msgpack.annotation.Message; | |
6 | |
7 | |
8 @Ignore @Message @Beans | |
9 public class InheritanceClass extends SuperClass { | |
10 public String f1; | |
11 | |
12 public int f2; | |
13 | |
14 public InheritanceClass() {} | |
15 | |
16 public String getF1() { | |
17 return f1; | |
18 } | |
19 | |
20 public void setF1(String f1) { | |
21 this.f1 = f1; | |
22 } | |
23 | |
24 public int getF2() { | |
25 return f2; | |
26 } | |
27 | |
28 public void setF2(int f2) { | |
29 this.f2 = f2; | |
30 } | |
31 | |
32 @Override | |
33 public boolean equals(Object o) { | |
34 if (! (o instanceof InheritanceClass)) { | |
35 return false; | |
36 } | |
37 InheritanceClass that = (InheritanceClass) o; | |
38 // f0 | |
39 if (f0 == null) { | |
40 if (that.f0 != null) { | |
41 return false; | |
42 } | |
43 } | |
44 if (that.f0 != null) { | |
45 if (! f0.equals(that.f0)) { | |
46 return false; | |
47 } | |
48 } | |
49 // f1 | |
50 if (f1 == null) { | |
51 if (that.f1 != null) { | |
52 return false; | |
53 } | |
54 } | |
55 if (that.f1 != null) { | |
56 if (! f1.equals(that.f1)) { | |
57 return false; | |
58 } | |
59 } | |
60 // f2 | |
61 if (f2 != that.f2) { | |
62 return false; | |
63 } | |
64 return true; | |
65 } | |
66 } |