View Javadoc

1   /*
2    * Copyright 2011 FatWire Corporation. All Rights Reserved.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *    http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package com.fatwire.gst.foundation.html;
17  
18  final class HtmlEventsAttr {
19      private String onclick;
20      private String ondblclick;
21      private String onmousedown;
22      private String onmouseup;
23      private String onmouseover;
24      private String onmousemove;
25      private String onmouseout;
26      private String onkeypress;
27      private String onkeydown;
28      private String onkeyup;
29  
30      /**
31       * @return the onclick
32       */
33      public String getOnclick() {
34          return onclick;
35      }
36  
37      /**
38       * @param onclick the onclick to set
39       */
40      public void setOnclick(final String onclick) {
41          this.onclick = onclick;
42      }
43  
44      /**
45       * @return the ondblclick
46       */
47      public String getOndblclick() {
48          return ondblclick;
49      }
50  
51      /**
52       * @param ondblclick the ondblclick to set
53       */
54      public void setOndblclick(final String ondblclick) {
55          this.ondblclick = ondblclick;
56      }
57  
58      /**
59       * @return the onmousedown
60       */
61      public String getOnmousedown() {
62          return onmousedown;
63      }
64  
65      /**
66       * @param onmousedown the onmousedown to set
67       */
68      public void setOnmousedown(final String onmousedown) {
69          this.onmousedown = onmousedown;
70      }
71  
72      /**
73       * @return the onmouseup
74       */
75      public String getOnmouseup() {
76          return onmouseup;
77      }
78  
79      /**
80       * @param onmouseup the onmouseup to set
81       */
82      public void setOnmouseup(final String onmouseup) {
83          this.onmouseup = onmouseup;
84      }
85  
86      /**
87       * @return the onmouseover
88       */
89      public String getOnmouseover() {
90          return onmouseover;
91      }
92  
93      /**
94       * @param onmouseover the onmouseover to set
95       */
96      public void setOnmouseover(final String onmouseover) {
97          this.onmouseover = onmouseover;
98      }
99  
100     /**
101      * @return the onmousemove
102      */
103     public String getOnmousemove() {
104         return onmousemove;
105     }
106 
107     /**
108      * @param onmousemove the onmousemove to set
109      */
110     public void setOnmousemove(final String onmousemove) {
111         this.onmousemove = onmousemove;
112     }
113 
114     /**
115      * @return the onmouseout
116      */
117     public String getOnmouseout() {
118         return onmouseout;
119     }
120 
121     /**
122      * @param onmouseout the onmouseout to set
123      */
124     public void setOnmouseout(final String onmouseout) {
125         this.onmouseout = onmouseout;
126     }
127 
128     /**
129      * @return the onkeypress
130      */
131     public String getOnkeypress() {
132         return onkeypress;
133     }
134 
135     /**
136      * @param onkeypress the onkeypress to set
137      */
138     public void setOnkeypress(final String onkeypress) {
139         this.onkeypress = onkeypress;
140     }
141 
142     /**
143      * @return the onkeydown
144      */
145     public String getOnkeydown() {
146         return onkeydown;
147     }
148 
149     /**
150      * @param onkeydown the onkeydown to set
151      */
152     public void setOnkeydown(final String onkeydown) {
153         this.onkeydown = onkeydown;
154     }
155 
156     /**
157      * @return the onkeyup
158      */
159     public String getOnkeyup() {
160         return onkeyup;
161     }
162 
163     /**
164      * @param onkeyup the onkeyup to set
165      */
166     public void setOnkeyup(final String onkeyup) {
167         this.onkeyup = onkeyup;
168     }
169 
170     /*
171      * (non-Javadoc)
172      * 
173      * @see java.lang.Object#hashCode()
174      */
175     @Override
176     public int hashCode() {
177         final int prime = 31;
178         int result = 1;
179         result = prime * result + (onclick == null ? 0 : onclick.hashCode());
180         result = prime * result + (ondblclick == null ? 0 : ondblclick.hashCode());
181         result = prime * result + (onkeydown == null ? 0 : onkeydown.hashCode());
182         result = prime * result + (onkeypress == null ? 0 : onkeypress.hashCode());
183         result = prime * result + (onkeyup == null ? 0 : onkeyup.hashCode());
184         result = prime * result + (onmousedown == null ? 0 : onmousedown.hashCode());
185         result = prime * result + (onmousemove == null ? 0 : onmousemove.hashCode());
186         result = prime * result + (onmouseout == null ? 0 : onmouseout.hashCode());
187         result = prime * result + (onmouseover == null ? 0 : onmouseover.hashCode());
188         result = prime * result + (onmouseup == null ? 0 : onmouseup.hashCode());
189         return result;
190     }
191 
192     /*
193      * (non-Javadoc)
194      * 
195      * @see java.lang.Object#equals(java.lang.Object)
196      */
197     @Override
198     public boolean equals(final Object obj) {
199         if (this == obj) {
200             return true;
201         }
202         if (obj == null) {
203             return false;
204         }
205         if (!(obj instanceof HtmlEventsAttr)) {
206             return false;
207         }
208         final HtmlEventsAttr other = (HtmlEventsAttr) obj;
209         if (onclick == null) {
210             if (other.onclick != null) {
211                 return false;
212             }
213         } else if (!onclick.equals(other.onclick)) {
214             return false;
215         }
216         if (ondblclick == null) {
217             if (other.ondblclick != null) {
218                 return false;
219             }
220         } else if (!ondblclick.equals(other.ondblclick)) {
221             return false;
222         }
223         if (onkeydown == null) {
224             if (other.onkeydown != null) {
225                 return false;
226             }
227         } else if (!onkeydown.equals(other.onkeydown)) {
228             return false;
229         }
230         if (onkeypress == null) {
231             if (other.onkeypress != null) {
232                 return false;
233             }
234         } else if (!onkeypress.equals(other.onkeypress)) {
235             return false;
236         }
237         if (onkeyup == null) {
238             if (other.onkeyup != null) {
239                 return false;
240             }
241         } else if (!onkeyup.equals(other.onkeyup)) {
242             return false;
243         }
244         if (onmousedown == null) {
245             if (other.onmousedown != null) {
246                 return false;
247             }
248         } else if (!onmousedown.equals(other.onmousedown)) {
249             return false;
250         }
251         if (onmousemove == null) {
252             if (other.onmousemove != null) {
253                 return false;
254             }
255         } else if (!onmousemove.equals(other.onmousemove)) {
256             return false;
257         }
258         if (onmouseout == null) {
259             if (other.onmouseout != null) {
260                 return false;
261             }
262         } else if (!onmouseout.equals(other.onmouseout)) {
263             return false;
264         }
265         if (onmouseover == null) {
266             if (other.onmouseover != null) {
267                 return false;
268             }
269         } else if (!onmouseover.equals(other.onmouseover)) {
270             return false;
271         }
272         if (onmouseup == null) {
273             if (other.onmouseup != null) {
274                 return false;
275             }
276         } else if (!onmouseup.equals(other.onmouseup)) {
277             return false;
278         }
279         return true;
280     }
281 
282 }