1 package org.opendaylight.controller.tests.zmqroutingtable.rest;
3 import org.opendaylight.controller.sal.connector.api.RpcRouter;
4 import org.opendaylight.yangtools.yang.common.QName;
5 import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
7 import java.io.Serializable;
14 public class RouteIdentifierImpl implements RpcRouter.RouteIdentifier, Serializable {
16 private final URI namespace;
17 private final QName QNAME;
18 private final QName instance;
20 public RouteIdentifierImpl() {
21 namespace = URI.create("http://cisco.com/example");
22 QNAME = new QName(namespace, "global");
23 instance = new QName(URI.create("127.0.0.1"), "local");
26 public RouteIdentifierImpl(String url,String instanceIP){
27 namespace = URI.create(url);
28 QNAME = new QName(namespace,"global");
29 instance = new QName(URI.create(instanceIP), "local");
34 public QName getContext() {
39 public QName getType() {
44 public org.opendaylight.yangtools.yang.data.api.InstanceIdentifier getRoute() {
45 return InstanceIdentifier.of(instance);
49 public boolean equals(Object o) {
50 if (this == o) return true;
51 if (o == null || getClass() != o.getClass()) return false;
53 RouteIdentifierImpl that = (RouteIdentifierImpl) o;
55 if (!QNAME.equals(that.QNAME)) return false;
56 if (!instance.equals(that.instance)) return false;
57 if (!namespace.equals(that.namespace)) return false;
63 public int hashCode() {
64 int result = namespace.hashCode();
65 result = 31 * result + QNAME.hashCode();
66 result = 31 * result + instance.hashCode();