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;
12 import org.opendaylight.yangtools.concepts.Immutable;
13 import org.opendaylight.yangtools.yang.common.QName;
15 public class RpcRoutingContext implements Immutable, Serializable {
20 private static final long serialVersionUID = -9079324728075883325L;
22 private final QName context;
23 private final QName rpc;
26 private RpcRoutingContext(QName context, QName rpc) {
27 this.context = context;
31 public static final RpcRoutingContext create(QName context, QName rpc) {
32 return new RpcRoutingContext(context, rpc);
35 public QName getContext() {
39 public QName getRpc() {
44 public String toString() {
45 return "RpcRoutingContext [context=" + context + ", rpc=" + rpc + "]";
49 public int hashCode() {
52 result = prime * result + ((context == null) ? 0 : context.hashCode());
53 result = prime * result + ((rpc == null) ? 0 : rpc.hashCode());
58 public boolean equals(Object obj) {
63 if (getClass() != obj.getClass())
65 RpcRoutingContext other = (RpcRoutingContext) obj;
66 if (context == null) {
67 if (other.context != null)
69 } else if (!context.equals(other.context))
72 if (other.rpc != null)
74 } else if (!rpc.equals(other.rpc))