2 * Copyright (c) 2013 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.binding.codegen.impl;
12 import org.opendaylight.controller.sal.binding.api.NotificationListener;
13 import org.opendaylight.yangtools.yang.binding.Notification;
15 import com.google.common.base.Objects;
16 import com.google.common.base.Preconditions;
18 final class RuntimeGeneratedInvokerPrototype {
19 private final Set<Class<? extends Notification>> supportedNotifications;
20 private final Class<? extends NotificationListener<?>> protoClass;
22 public RuntimeGeneratedInvokerPrototype(final Set<Class<? extends Notification>> supportedNotifications, final Class<? extends NotificationListener<?>> protoClass) {
23 this.supportedNotifications = Preconditions.checkNotNull(supportedNotifications);
24 this.protoClass = Preconditions.checkNotNull(protoClass);
27 public Set<Class<? extends Notification>> getSupportedNotifications() {
28 return supportedNotifications;
31 public Class<? extends NotificationListener<?>> getProtoClass() {
36 public int hashCode() {
39 result = prime * result + supportedNotifications.hashCode();
40 result = prime * result + protoClass.hashCode();
45 public boolean equals(final Object obj) {
49 if (!(obj instanceof RuntimeGeneratedInvokerPrototype)) {
52 final RuntimeGeneratedInvokerPrototype other = (RuntimeGeneratedInvokerPrototype) obj;
53 if (!protoClass.equals(other.protoClass)) {
56 return supportedNotifications.equals(other.supportedNotifications);
60 public String toString() {
61 return Objects.toStringHelper(this)
62 .add("protoClass", protoClass)
63 .add("supportedNotifications", supportedNotifications)