X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-binding-api%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fbinding%2Fapi%2Frpc%2FRpcContextIdentifier.java;h=0f0eb119f7efffcbcaf233fa71d2594b4a0a1a69;hp=8437c18f094ccefa5117b9f02aaa0753effede92;hb=2a6aa1775604906755883f810ee9ea6d5f286135;hpb=3b0f2c65bfb0f0b07e27529734561a7ae9ee5ad9 diff --git a/opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/rpc/RpcContextIdentifier.java b/opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/rpc/RpcContextIdentifier.java index 8437c18f09..0f0eb119f7 100644 --- a/opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/rpc/RpcContextIdentifier.java +++ b/opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/rpc/RpcContextIdentifier.java @@ -1,16 +1,23 @@ +/* + * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ package org.opendaylight.controller.sal.binding.api.rpc; import org.opendaylight.yangtools.concepts.Immutable; import org.opendaylight.yangtools.yang.binding.BaseIdentity; import org.opendaylight.yangtools.yang.binding.RpcService; -public final class RpcContextIdentifier implements Immutable{ +@Deprecated(forRemoval = true) +public final class RpcContextIdentifier implements Immutable { public final Class rpcService; public final Class routingContext; - + private RpcContextIdentifier(Class rpcService, Class routingContext) { - super(); this.rpcService = rpcService; this.routingContext = routingContext; } @@ -22,12 +29,13 @@ public final class RpcContextIdentifier implements Immutable{ public Class getRoutingContext() { return routingContext; } - - public static final RpcContextIdentifier contextForGlobalRpc(Class serviceType) { + + public static RpcContextIdentifier contextForGlobalRpc(Class serviceType) { return new RpcContextIdentifier(serviceType, null); } - - public static final RpcContextIdentifier contextFor(Class serviceType,Class routingContext) { + + public static RpcContextIdentifier contextFor(Class serviceType, + Class routingContext) { return new RpcContextIdentifier(serviceType, routingContext); } @@ -35,31 +43,37 @@ public final class RpcContextIdentifier implements Immutable{ public int hashCode() { final int prime = 31; int result = 1; - result = prime * result + ((routingContext == null) ? 0 : routingContext.hashCode()); - result = prime * result + ((rpcService == null) ? 0 : rpcService.hashCode()); + result = prime * result + (routingContext == null ? 0 : routingContext.hashCode()); + result = prime * result + (rpcService == null ? 0 : rpcService.hashCode()); return result; } @Override public boolean equals(Object obj) { - if (this == obj) + if (this == obj) { return true; - if (obj == null) + } + if (obj == null) { return false; - if (getClass() != obj.getClass()) + } + if (getClass() != obj.getClass()) { return false; + } RpcContextIdentifier other = (RpcContextIdentifier) obj; if (routingContext == null) { - if (other.routingContext != null) + if (other.routingContext != null) { return false; - } else if (!routingContext.equals(other.routingContext)) + } + } else if (!routingContext.equals(other.routingContext)) { return false; + } if (rpcService == null) { - if (other.rpcService != null) + if (other.rpcService != null) { return false; - } else if (!rpcService.equals(other.rpcService)) + } + } else if (!rpcService.equals(other.rpcService)) { return false; + } return true; } - }