1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.limmen.crs.model;
17
18 /***
19 * The Documentation class is used all over the configuration model and it's
20 * purpose is to provide information on all the parts of the configuration
21 * (the file, sections and settings) in several languages.
22 *
23 * @author Ivo Limmen
24 * @see Configuration
25 * @see Section
26 * @see Setting
27 */
28 public class Documentation {
29
30 private String language;
31
32 private String text;
33
34 public Documentation() {
35
36 this(null, null);
37 }
38
39 public Documentation(String aLanguage, String aText) {
40
41 super();
42
43 setLanguage(aLanguage);
44 setText(aText);
45 }
46
47 @Override
48 public boolean equals(Object obj) {
49
50 if (obj.getClass().equals(getClass())) {
51
52 Documentation other = (Documentation) obj;
53
54 if (getLanguage().equals(other.getLanguage())) {
55
56 if (getText().equals(other.getText())) {
57
58 return true;
59 }
60 }
61 }
62
63 return false;
64 }
65
66 public String getLanguage() {
67
68 return language;
69 }
70
71 public String getText() {
72
73 return text;
74 }
75
76 @Override
77 public int hashCode() {
78
79 final int prime = 31;
80 int result = 1;
81 result = prime * result + ((language == null) ? 0 : language.hashCode());
82 result = prime * result + ((text == null) ? 0 : text.hashCode());
83 return result;
84 }
85
86 public void setLanguage(String language) {
87
88 this.language = language;
89 }
90
91 public void setText(String text) {
92
93 this.text = text;
94 }
95 }