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 HtmlCoreAttr {
19      private String id;
20      private String className;
21      private String title;
22      private String style;
23  
24      /**
25       * @return the id
26       */
27      public String getId() {
28          return id;
29      }
30  
31      /**
32       * @param id the id to set
33       */
34      public void setId(final String id) {
35          this.id = id;
36      }
37  
38      /**
39       * @return the className
40       */
41      public String getClassName() {
42          return className;
43      }
44  
45      /**
46       * @param className the className to set
47       */
48      public void setClassName(final String className) {
49          this.className = className;
50      }
51  
52      /**
53       * @return the title
54       */
55      public String getTitle() {
56          return title;
57      }
58  
59      /**
60       * @param title the title to set
61       */
62      public void setTitle(final String title) {
63          this.title = title;
64      }
65  
66      /**
67       * @return the style
68       */
69      public String getStyle() {
70          return style;
71      }
72  
73      /**
74       * @param style the style to set
75       */
76      public void setStyle(final String style) {
77          this.style = style;
78      }
79  
80      /*
81       * (non-Javadoc)
82       * 
83       * @see java.lang.Object#hashCode()
84       */
85      @Override
86      public int hashCode() {
87          final int prime = 31;
88          int result = 1;
89          result = prime * result + (className == null ? 0 : className.hashCode());
90          result = prime * result + (id == null ? 0 : id.hashCode());
91          result = prime * result + (style == null ? 0 : style.hashCode());
92          result = prime * result + (title == null ? 0 : title.hashCode());
93          return result;
94      }
95  
96      /*
97       * (non-Javadoc)
98       * 
99       * @see java.lang.Object#equals(java.lang.Object)
100      */
101     @Override
102     public boolean equals(final Object obj) {
103         if (this == obj) {
104             return true;
105         }
106         if (obj == null) {
107             return false;
108         }
109         if (!(obj instanceof HtmlCoreAttr)) {
110             return false;
111         }
112         final HtmlCoreAttr other = (HtmlCoreAttr) obj;
113         if (className == null) {
114             if (other.className != null) {
115                 return false;
116             }
117         } else if (!className.equals(other.className)) {
118             return false;
119         }
120         if (id == null) {
121             if (other.id != null) {
122                 return false;
123             }
124         } else if (!id.equals(other.id)) {
125             return false;
126         }
127         if (style == null) {
128             if (other.style != null) {
129                 return false;
130             }
131         } else if (!style.equals(other.style)) {
132             return false;
133         }
134         if (title == null) {
135             if (other.title != null) {
136                 return false;
137             }
138         } else if (!title.equals(other.title)) {
139             return false;
140         }
141         return true;
142     }
143 
144 }