org.opendaylight.yangtools.binding.BindingContract Maven / Gradle / Ivy
/*
* Copyright (c) 2022 PANTHEON.tech, s.r.o. 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.yangtools.binding;
import com.google.common.annotations.Beta;
import org.eclipse.jdt.annotation.NonNull;
/**
* Base interface for all interfaces generated to capture a specific contract. There are five basic contracts defined
* by YANG statements:
*
* - {@code action}, represented by {@link Action}
* - {@code anydata} and {@code anyxml}, represented by {@link OpaqueObject}
* - {@code feature}, represented by {@link YangFeature}
* - {@code identity}, represented by {@link BaseIdentity}
* - {@code rpc}, represented by {@link Rpc}
* - structured data and metadata exchanged between two parties, represented by {@link DataContainer}
*
*
*
* As can be seen, this contract is more general than {@link BindingObject}.
*
* @param Type of the captured contract
*/
@Beta
public sealed interface BindingContract>
permits Action, BaseIdentity, DataContainer, OpaqueObject, Rpc, YangFeature {
/**
* Return the interface implemented by this object. This method differs from {@link Object#getClass()} in that it
* returns the interface contract, not a concrete implementation class.
*
* @return Implemented contract
*/
@NonNull Class extends T> implementedInterface();
}