summaryrefslogtreecommitdiffstats
blob: d6245503529a715b2180a42f03053c284e2c47c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
 * Copyright (c) 2012, Isode Limited, London, England.
 * All rights reserved.
 */
/*
 * Copyright (c) 2010, Remko Tronçon.
 * All rights reserved.
 */
package com.isode.stroke.parser;

/*
 * Internal parsing class.
 */
public class Attribute {

    public Attribute(String name, String ns) {
        this.name = name;
        this.ns = ns;
    }

    public String getName() {
        return name;
    }

    public String getNamespace() {
        return ns;
    }

    @Override
    public boolean equals(Object other) {
        return other != null
                && other instanceof Attribute
                && name.equals(((Attribute) other).getName())
                && ns.equals(((Attribute) other).getNamespace());
    }

    @Override
    public int hashCode() {
        int hash = 3;
        hash = 19 * hash + (this.name != null ? this.name.hashCode() : 0);
        hash = 19 * hash + (this.ns != null ? this.ns.hashCode() : 0);
        return hash;
    }
    private final String name;
    private final String ns;
}