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 HtmlI18NAttr {
19  
20      private String lang;
21      private String dir;
22  
23      /**
24       * @return the lang
25       */
26      public String getLang() {
27          return lang;
28      }
29  
30      /**
31       * @param lang the lang to set
32       */
33      public void setLang(final String lang) {
34          this.lang = lang;
35      }
36  
37      /**
38       * @return the dir
39       */
40      public String getDir() {
41          return dir;
42      }
43  
44      /**
45       * @param dir the dir to set
46       */
47      public void setDir(final String dir) {
48          this.dir = dir;
49      }
50  
51      /*
52       * (non-Javadoc)
53       * 
54       * @see java.lang.Object#hashCode()
55       */
56      @Override
57      public int hashCode() {
58          final int prime = 31;
59          int result = 1;
60          result = prime * result + (dir == null ? 0 : dir.hashCode());
61          result = prime * result + (lang == null ? 0 : lang.hashCode());
62          return result;
63      }
64  
65      /*
66       * (non-Javadoc)
67       * 
68       * @see java.lang.Object#equals(java.lang.Object)
69       */
70      @Override
71      public boolean equals(final Object obj) {
72          if (this == obj) {
73              return true;
74          }
75          if (obj == null) {
76              return false;
77          }
78          if (!(obj instanceof HtmlI18NAttr)) {
79              return false;
80          }
81          final HtmlI18NAttr other = (HtmlI18NAttr) obj;
82          if (dir == null) {
83              if (other.dir != null) {
84                  return false;
85              }
86          } else if (!dir.equals(other.dir)) {
87              return false;
88          }
89          if (lang == null) {
90              if (other.lang != null) {
91                  return false;
92              }
93          } else if (!lang.equals(other.lang)) {
94              return false;
95          }
96          return true;
97      }
98  
99  }