Merge "Fixed add/delete/modify RPC for group/flow/remove reach the test provider"
[controller.git] / opendaylight / config / yang-jmx-generator / src / main / java / org / opendaylight / controller / config / yangjmxgenerator / attribute / Dependency.java
1 package org.opendaylight.controller.config.yangjmxgenerator.attribute;
2
3 import org.opendaylight.controller.config.yangjmxgenerator.ServiceInterfaceEntry;
4
5 public class Dependency {
6         private final ServiceInterfaceEntry sie;
7         private final boolean mandatory;
8
9         public Dependency(ServiceInterfaceEntry sie, boolean mandatory) {
10             this.sie = sie;
11             this.mandatory = mandatory;
12         }
13
14         public ServiceInterfaceEntry getSie() {
15             return sie;
16         }
17
18         public boolean isMandatory() {
19             return mandatory;
20         }
21
22         @Override
23         public boolean equals(Object o) {
24             if (this == o)
25                 return true;
26             if (o == null || getClass() != o.getClass())
27                 return false;
28
29             Dependency that = (Dependency) o;
30
31             if (mandatory != that.mandatory)
32                 return false;
33             if (!sie.equals(that.sie))
34                 return false;
35
36             return true;
37         }
38
39         @Override
40         public int hashCode() {
41             int result = sie.hashCode();
42             result = 31 * result + (mandatory ? 1 : 0);
43             return result;
44         }
45     }