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
9 package org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common;
11 import com.google.common.base.MoreObjects.ToStringHelper;
12 import com.google.common.base.Preconditions;
17 public class InjectionResultTargetKey extends InjectionKey {
19 private final Class<?> resultClazz;
22 * @param version openflow version
23 * @param targetClazz target class
24 * @param resultClazz result class
26 public InjectionResultTargetKey(final int version, final Class<?> targetClazz, final Class<?> resultClazz) {
27 super(version, targetClazz);
28 this.resultClazz = Preconditions.checkNotNull(resultClazz);
32 public int hashCode() {
33 return super.hashCode() ^ resultClazz.hashCode();
37 public boolean equals(final Object obj) {
41 if (!super.equals(obj)) {
44 final InjectionResultTargetKey other = (InjectionResultTargetKey) obj;
45 return resultClazz.equals(other.resultClazz);
49 protected ToStringHelper addToStringAttributes(final ToStringHelper toStringHelper) {
50 return super.addToStringAttributes(toStringHelper).add("resultClazz", resultClazz);