2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.controller.remote.rpc;
10 import com.google.common.base.Preconditions;
11 import org.opendaylight.controller.sal.connector.api.RpcRouter;
12 import org.opendaylight.yangtools.yang.common.QName;
13 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
16 import java.io.Serializable;
18 public class RouteIdentifierImpl implements RpcRouter.RouteIdentifier<QName, QName, YangInstanceIdentifier>,Serializable {
19 private static final long serialVersionUID = 1L;
21 private final QName context;
22 private final QName type;
23 private final YangInstanceIdentifier route;
25 public RouteIdentifierImpl(final QName context, final QName type, final YangInstanceIdentifier route) {
26 Preconditions.checkNotNull(type, "Rpc type should not be null");
27 this.context = context;
33 public QName getContext() {
38 public QName getType() {
43 public YangInstanceIdentifier getRoute() {
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;
56 if (that.getContext() != null) return false;
58 if (!context.equals(that.context)) return false;
61 if (that.getRoute() != null) return false;
63 if (!route.equals(that.route)) return false;
66 if (that.getType() != null) return false;
68 if (!type.equals(that.type)) return false;
74 public int hashCode() {
77 result = prime * result + (context == null ? 0:context.hashCode());
78 result = prime * result + (type == null ? 0:type.hashCode());
79 result = prime * result + (route == null ? 0:route.hashCode());
84 public String toString() {
85 return "RouteIdentifierImpl{" +
86 "context=" + context +