1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.commons.betwixt.dotbetwixt;
18
19 import java.util.ArrayList;
20 import java.util.List;
21
22
23
24
25
26
27 public class ExampleBean {
28
29 private String name;
30 private List examples = new ArrayList();
31
32 public ExampleBean() {}
33 public ExampleBean(String name) {
34 setName(name);
35 }
36
37 public String getName() {
38 return name;
39 }
40
41 public void setName(String name) {
42 this.name = name;
43 }
44
45 public List getExamples() {
46 return examples;
47 }
48
49 public void addExample(IExample example) {
50 examples.add(example);
51 }
52
53
54 public String toString() {
55 return "[" + this.getClass().getName() + ": name=" + name + ", examples="
56 + examples + "]";
57 }
58
59 public boolean equals( Object obj ) {
60 if ( obj == null ) return false;
61 return this.hashCode() == obj.hashCode();
62 }
63
64 public int hashCode() {
65 return toString().hashCode();
66 }
67 }
68