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.sal.core.api;
10 import java.io.Serializable;
11 import org.opendaylight.yangtools.concepts.Immutable;
12 import org.opendaylight.yangtools.yang.common.QName;
14 public final class RpcRoutingContext implements Immutable, Serializable {
15 private static final long serialVersionUID = -9079324728075883325L;
17 private final QName context;
18 private final QName rpc;
21 private RpcRoutingContext(QName context, QName rpc) {
22 this.context = context;
26 public static RpcRoutingContext create(QName context, QName rpc) {
27 return new RpcRoutingContext(context, rpc);
30 public QName getContext() {
34 public QName getRpc() {
39 public String toString() {
40 return "RpcRoutingContext [context=" + context + ", rpc=" + rpc + "]";
44 public int hashCode() {
47 result = prime * result + (context == null ? 0 : context.hashCode());
48 result = prime * result + (rpc == null ? 0 : rpc.hashCode());
53 public boolean equals(Object obj) {
60 if (getClass() != obj.getClass()) {
63 RpcRoutingContext other = (RpcRoutingContext) obj;
64 if (context == null) {
65 if (other.context != null) {
68 } else if (!context.equals(other.context)) {
72 if (other.rpc != null) {
75 } else if (!rpc.equals(other.rpc)) {