~halvdanhg/dhis2/message-fixes

« back to all changes in this revision

Viewing changes to dhis-2/dhis-api/src/main/java/org/hisp/dhis/node/types/SimpleNode.java

  • Committer: Morten Olav Hansen
  • Date: 2015-01-09 03:27:44 UTC
  • Revision ID: mortenoh@gmail.com-20150109032744-gxdfhmef19jgs3s3
expose Property on Nodes

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
import org.hisp.dhis.node.Node;
33
33
import org.hisp.dhis.node.NodeType;
34
34
import org.hisp.dhis.node.exception.InvalidTypeException;
35
 
 
36
 
import java.util.Objects;
 
35
import org.hisp.dhis.schema.Property;
37
36
 
38
37
/**
39
38
 * @author Morten Olav Hansen <mortenoh@gmail.com>
79
78
    }
80
79
 
81
80
    @Override
82
 
    public <T extends Node> T addChild( T child ) throws InvalidTypeException
 
81
    public <T extends Node> T addChild( T child )
83
82
    {
84
83
        throw new InvalidTypeException();
85
84
    }
89
88
    {
90
89
        throw new InvalidTypeException();
91
90
    }
92
 
 
93
 
    @Override
94
 
    public int hashCode()
95
 
    {
96
 
        return 31 * super.hashCode() + Objects.hash( value, attribute );
97
 
    }
98
 
 
99
 
    @Override
100
 
    public boolean equals( Object obj )
101
 
    {
102
 
        if ( this == obj )
103
 
        {
104
 
            return true;
105
 
        }
106
 
        if ( obj == null || getClass() != obj.getClass() )
107
 
        {
108
 
            return false;
109
 
        }
110
 
        if ( !super.equals( obj ) )
111
 
        {
112
 
            return false;
113
 
        }
114
 
 
115
 
        final SimpleNode other = (SimpleNode) obj;
116
 
 
117
 
        return Objects.equals( this.value, other.value ) && Objects.equals( this.attribute, other.attribute );
118
 
    }
119
91
}