~mortenoh/+junk/dhis2-detailed-import-export

« back to all changes in this revision

Viewing changes to local/in/dhis-web-integration/src/main/java/org/hisp/dhis/integration/rims/api/tables/RIMSDistrict.java

  • Committer: larshelge at gmail
  • Date: 2009-03-03 16:46:36 UTC
  • Revision ID: larshelge@gmail.com-20090303164636-2sjlrquo7ib1gf7r
Initial check-in

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package org.hisp.dhis.integration.rims.api.tables;
 
2
 
 
3
public class RIMSDistrict
 
4
    extends RIMSOrgUnit
 
5
{
 
6
    private String district_code;
 
7
    private String district_name;
 
8
 
 
9
    // -------------------------------------------------------------------------
 
10
    // Constructor
 
11
    // -------------------------------------------------------------------------
 
12
    public RIMSDistrict()
 
13
    {
 
14
 
 
15
    }
 
16
 
 
17
    public RIMSDistrict( String district_code, String district_name,
 
18
        String state_code )
 
19
    {
 
20
        this.district_code = district_code;
 
21
        this.state_code = state_code;
 
22
        this.district_name = district_name;
 
23
    }
 
24
 
 
25
    // ------------------------------------------------------------------------
 
26
    // HashCode and equals
 
27
    // ------------------------------------------------------------------------
 
28
    @Override
 
29
    public int hashCode()
 
30
    {
 
31
        return district_code.hashCode();
 
32
    }
 
33
 
 
34
    @Override
 
35
    public boolean equals( Object o )
 
36
    {
 
37
        if ( this == o )
 
38
        {
 
39
            return true;
 
40
        }
 
41
 
 
42
        if ( o == null )
 
43
        {
 
44
            return false;
 
45
        }
 
46
 
 
47
        if ( !(o instanceof RIMSDistrict) )
 
48
        {
 
49
            return false;
 
50
        }
 
51
 
 
52
        final RIMSDistrict other = (RIMSDistrict) o;
 
53
 
 
54
        return district_code.equals( other.getDistrict_code() );
 
55
    }
 
56
 
 
57
    // -------------------------------------------------------------------------
 
58
    // Getters & Setters
 
59
    // -------------------------------------------------------------------------
 
60
    public String getDistrict_code()
 
61
    {
 
62
        return district_code;
 
63
    }
 
64
 
 
65
    public void setDistrict_code( String district_code )
 
66
    {
 
67
        this.district_code = district_code;
 
68
    }
 
69
 
 
70
    public String getDistrict_name()
 
71
    {
 
72
        return district_name;
 
73
    }
 
74
 
 
75
    public void setDistrict_name( String district_name )
 
76
    {
 
77
        this.district_name = district_name;
 
78
    }
 
79
 
 
80
    @Override
 
81
    public String getName()
 
82
    {
 
83
        return getDistrict_name();
 
84
    }
 
85
 
 
86
    @Override
 
87
    public String getCode()
 
88
    {
 
89
        return getDistrict_code();
 
90
    }
 
91
 
 
92
}