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 java.io.Serializable;
12 import org.opendaylight.controller.sal.connector.api.RpcRouter;
13 import org.opendaylight.yangtools.yang.common.QName;
14 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
16 public class RouteIdentifierImpl implements RpcRouter.RouteIdentifier<QName, QName, YangInstanceIdentifier>,Serializable {
17 private static final long serialVersionUID = 1L;
19 private final QName context;
20 private final QName type;
21 private final YangInstanceIdentifier route;
23 public RouteIdentifierImpl(final QName context, final QName type, final YangInstanceIdentifier route) {
24 Preconditions.checkNotNull(type, "Rpc type should not be null");
25 this.context = context;
31 public QName getContext() {
36 public QName getType() {
41 public YangInstanceIdentifier getRoute() {
47 public boolean equals(final Object o) {
48 if (this == o) return true;
49 if (o == null || getClass() != o.getClass()) return false;
51 final RouteIdentifierImpl that = (RouteIdentifierImpl) o;
54 if (that.getContext() != null) return false;
56 if (!context.equals(that.context)) return false;
59 if (that.getRoute() != null) return false;
61 if (!route.equals(that.route)) return false;
64 if (that.getType() != null) return false;
66 if (!type.equals(that.type)) return false;
72 public int hashCode() {
75 result = prime * result + (context == null ? 0:context.hashCode());
76 result = prime * result + (type == null ? 0:type.hashCode());
77 result = prime * result + (route == null ? 0:route.hashCode());
82 public String toString() {
83 return "RouteIdentifierImpl{" +
84 "context=" + context +