X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-binding-broker%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fbinding%2Fcodegen%2Fimpl%2FRuntimeGeneratedInvokerPrototype.java;fp=opendaylight%2Fmd-sal%2Fsal-binding-broker%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fbinding%2Fcodegen%2Fimpl%2FRuntimeGeneratedInvokerPrototype.java;h=f16074845d457edbde86fcd5fb62b4a572f3027b;hb=23c447f8bd2b5b2591ed699c1de1b11cc71a6e27;hp=0000000000000000000000000000000000000000;hpb=62075221905322f2748794711b649d895cb590c2;p=controller.git diff --git a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/RuntimeGeneratedInvokerPrototype.java b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/RuntimeGeneratedInvokerPrototype.java new file mode 100644 index 0000000000..f16074845d --- /dev/null +++ b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/RuntimeGeneratedInvokerPrototype.java @@ -0,0 +1,66 @@ +/** + * Copyright (c) 2013 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.codegen.impl; + +import java.util.Set; + +import org.opendaylight.controller.sal.binding.api.NotificationListener; +import org.opendaylight.yangtools.yang.binding.Notification; + +import com.google.common.base.Objects; +import com.google.common.base.Preconditions; + +final class RuntimeGeneratedInvokerPrototype { + private final Set> supportedNotifications; + private final Class> protoClass; + + public RuntimeGeneratedInvokerPrototype(final Set> supportedNotifications, final Class> protoClass) { + this.supportedNotifications = Preconditions.checkNotNull(supportedNotifications); + this.protoClass = Preconditions.checkNotNull(protoClass); + } + + public Set> getSupportedNotifications() { + return supportedNotifications; + } + + public Class> getProtoClass() { + return protoClass; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + supportedNotifications.hashCode(); + result = prime * result + protoClass.hashCode(); + return result; + } + + @Override + public boolean equals(final Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof RuntimeGeneratedInvokerPrototype)) { + return false; + } + final RuntimeGeneratedInvokerPrototype other = (RuntimeGeneratedInvokerPrototype) obj; + if (!protoClass.equals(other.protoClass)) { + return false; + } + return supportedNotifications.equals(other.supportedNotifications); + } + + @Override + public String toString() { + return Objects.toStringHelper(this) + .add("protoClass", protoClass) + .add("supportedNotifications", supportedNotifications) + .toString(); + } +}