~hudson-ubuntu/+junk/sezpoz

« back to all changes in this revision

Viewing changes to sezpoz/src/main/java/net/java/sezpoz/impl/SerEnumConst.java

  • Committer: James Page
  • Date: 2010-11-24 13:57:41 UTC
  • Revision ID: james.page@canonical.com-20101124135741-8ntgqh7ltywqy3x2
InitialĀ releaseĀ 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * The contents of this file are subject to the terms of either the GNU
 
3
 * General Public License Version 2 only ("GPL") or the Common
 
4
 * Development and Distribution License ("CDDL") (collectively, the
 
5
 * "License"). You may not use this file except in compliance with the
 
6
 * License. You can obtain a copy of the License at
 
7
 * http://www.netbeans.org/cddl-gplv2.html. See the License for the
 
8
 * specific language governing permissions and limitations under the
 
9
 * License.  When distributing the software, include this License Header
 
10
 * Notice in each file.  This particular file is subject to the "Classpath"
 
11
 * exception as provided in the GPL Version 2 section of the License file
 
12
 * that accompanied this code. If applicable, add the following below the
 
13
 * License Header, with the fields enclosed by brackets [] replaced by
 
14
 * your own identifying information:
 
15
 * "Portions Copyrighted [year] [name of copyright owner]"
 
16
 *
 
17
 * The Original Software is SezPoz. The Initial Developer of the Original
 
18
 * Software is Sun Microsystems, Inc. Portions Copyright 2006-2010 Sun
 
19
 * Microsystems, Inc. All Rights Reserved.
 
20
 *
 
21
 * If you wish your version of this file to be governed by only the CDDL
 
22
 * or only the GPL Version 2, indicate your decision by adding
 
23
 * "[Contributor] elects to include this software in this distribution
 
24
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
 
25
 * single choice of license, a recipient has the option to distribute
 
26
 * your version of this file under either the CDDL, the GPL Version 2 or
 
27
 * to extend the choice of license to its licensees as provided above.
 
28
 * However, if you add GPL Version 2 code and therefore, elected the GPL
 
29
 * Version 2 license, then the option applies only if the new code is
 
30
 * made subject to such option by the copyright holder.
 
31
 */
 
32
 
 
33
package net.java.sezpoz.impl;
 
34
 
 
35
import java.io.Serializable;
 
36
 
 
37
/**
 
38
 * Represents one enum constant value.
 
39
 */
 
40
public final class SerEnumConst implements Serializable {
 
41
 
 
42
    private static final long serialVersionUID = 1L;
 
43
 
 
44
    /** fully qualified name of enumeration type */
 
45
    public final String enumName;
 
46
    /** name of enumeration "field" (constant name) */
 
47
    public final String constName;
 
48
 
 
49
    SerEnumConst(String enumName, String constName) {
 
50
        this.enumName = enumName;
 
51
        this.constName = constName;
 
52
    }
 
53
 
 
54
    public int hashCode() {
 
55
        return enumName.hashCode();
 
56
    }
 
57
 
 
58
    public boolean equals(Object obj) {
 
59
        if (!(obj instanceof SerEnumConst)) {
 
60
            return false;
 
61
        }
 
62
        SerEnumConst o = (SerEnumConst) obj;
 
63
        return enumName.equals(o.enumName) && constName.equals(o.constName);
 
64
    }
 
65
 
 
66
    public String toString() {
 
67
        return constName;
 
68
    }
 
69
 
 
70
}