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) {
28 this.context = context;
32 public static final RpcRoutingContext create(QName context, QName rpc) {
33 return new RpcRoutingContext(context, rpc);
36 public QName getContext() {
40 public QName getRpc() {
45 public String toString() {
46 return "RpcRoutingContext [context=" + context + ", rpc=" + rpc + "]";
50 public int hashCode() {
53 result = prime * result + ((context == null) ? 0 : context.hashCode());
54 result = prime * result + ((rpc == null) ? 0 : rpc.hashCode());
59 public boolean equals(Object obj) {
64 if (getClass() != obj.getClass())
66 RpcRoutingContext other = (RpcRoutingContext) obj;
67 if (context == null) {
68 if (other.context != null)
70 } else if (!context.equals(other.context))
73 if (other.rpc != null)
75 } else if (!rpc.equals(other.rpc))