1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 package net.sf.maventaglib.checker;
25
26 import org.apache.commons.lang3.builder.CompareToBuilder;
27 import org.apache.commons.lang3.builder.EqualsBuilder;
28 import org.apache.commons.lang3.builder.HashCodeBuilder;
29 import org.apache.commons.lang3.builder.ToStringBuilder;
30 import org.apache.commons.lang3.builder.ToStringStyle;
31
32
33
34
35
36
37 public class TagVariable
38 implements Comparable<TagVariable>
39 {
40 private String nameGiven;
41
42 private String nameFromAttribute;
43
44 private String type;
45
46 private String scope;
47
48 private String description;
49
50 private boolean deprecated;
51
52 public String getDescription()
53 {
54 return this.description;
55 }
56
57 public void setDescription( String description )
58 {
59 this.description = description;
60 }
61
62 public String getNameGiven()
63 {
64 return this.nameGiven;
65 }
66
67 public void setNameGiven( String name )
68 {
69 this.nameGiven = name;
70 }
71
72 public String getScope()
73 {
74 return this.scope;
75 }
76
77 public void setScope( String scope )
78 {
79 this.scope = scope;
80 }
81
82 public String getType()
83 {
84 return this.type;
85 }
86
87 public void setType( String type )
88 {
89 this.type = type;
90 }
91
92 public String getNameFromAttribute()
93 {
94 return this.nameFromAttribute;
95 }
96
97 public void setNameFromAttribute( String nameFromAttribute )
98 {
99 this.nameFromAttribute = nameFromAttribute;
100 }
101
102 public boolean isDeprecated()
103 {
104 return this.deprecated;
105 }
106
107 public void setDeprecated( boolean deprecated )
108 {
109 this.deprecated = deprecated;
110 }
111
112
113
114
115 @Override
116 public String toString()
117 {
118 return new ToStringBuilder( this, ToStringStyle.SHORT_PREFIX_STYLE ).append( "nameGiven", this.nameGiven )
119 .append( "description", this.description ).append( "deprecated", this.deprecated ).append( "type",
120 this.type )
121 .append( "scope", this.scope ).append( "nameFromAttribute", this.nameFromAttribute ).toString();
122 }
123
124
125
126
127 public int compareTo( TagVariable object )
128 {
129 return new CompareToBuilder().append( this.deprecated, object.deprecated ).append( this.nameGiven,
130 object.nameGiven )
131 .append( this.nameFromAttribute, object.nameFromAttribute ).toComparison();
132 }
133
134
135
136
137 @Override
138 public boolean equals( Object obj )
139 {
140 if( obj == null )
141 {
142 return false;
143 }
144
145 if( obj == this )
146 {
147 return true;
148 }
149
150 if( obj.getClass() != getClass() )
151 {
152 return false;
153 }
154
155 TagVariable rhs = (TagVariable) obj;
156 return new EqualsBuilder().append( this.deprecated, rhs.deprecated ).append( this.nameGiven,
157 rhs.nameGiven )
158 .append( this.nameFromAttribute, rhs.nameFromAttribute ).isEquals();
159 }
160
161
162
163
164 @Override
165 public int hashCode() {
166 return new HashCodeBuilder().append( this.deprecated ).append( this.nameGiven )
167 .append( this.nameFromAttribute ).toHashCode();
168 }
169
170 }