diff options
Diffstat (limited to 'test/org/gnunet/construct/StringTuple.java')
-rw-r--r-- | test/org/gnunet/construct/StringTuple.java | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/org/gnunet/construct/StringTuple.java b/test/org/gnunet/construct/StringTuple.java new file mode 100644 index 0000000..085b7a9 --- /dev/null +++ b/test/org/gnunet/construct/StringTuple.java | |||
@@ -0,0 +1,29 @@ | |||
1 | package org.gnunet.construct; | ||
2 | |||
3 | /** | ||
4 | * ... | ||
5 | * | ||
6 | * @author Florian Dold | ||
7 | */ | ||
8 | public class StringTuple implements Message { | ||
9 | @ZeroTerminatedString | ||
10 | public String str1; | ||
11 | @ZeroTerminatedString | ||
12 | public String str2; | ||
13 | |||
14 | public StringTuple() { | ||
15 | // empty default ctor needed by Construct | ||
16 | } | ||
17 | public StringTuple(String str1, String str2) { | ||
18 | this.str1 = str1; | ||
19 | this.str2 = str2; | ||
20 | } | ||
21 | @Override | ||
22 | public boolean equals(Object other) { | ||
23 | if (!(other instanceof StringTuple)) { | ||
24 | return false; | ||
25 | } | ||
26 | StringTuple otherT = (StringTuple) other; | ||
27 | return otherT.str1.equals(this.str1) && otherT.str2.equals(this.str2); | ||
28 | } | ||
29 | } | ||