*/
package org.opendaylight.yangtools.yang.model.api;
-import com.google.common.annotations.Beta;
import org.opendaylight.yangtools.yang.model.api.stmt.ActionEffectiveStatement;
/**
- * Represents YANG action statement.
+ * Represents YANG {@code action} statement.
*
* <p>
* The "action" statement is used to define an operation connected to a
* is an identifier, followed by a block of substatements that holds
* detailed action information. The argument is the name of the action.
*/
-@Beta
public interface ActionDefinition
extends OperationDefinition, CopyableNode, EffectiveStatementEquivalent<ActionEffectiveStatement> {
import static java.util.Objects.requireNonNull;
-import com.google.common.annotations.Beta;
import java.util.Collection;
import java.util.Optional;
import org.eclipse.jdt.annotation.NonNull;
import org.opendaylight.yangtools.yang.common.QName;
/**
- * Node which can contain action nodes.
+ * Node which can contain {@link ActionDefinition}.
*/
-@Beta
public interface ActionNodeContainer {
/**
* Return the set of actions.
*
* @param qname Action's QName
* @return Action definition, if found
- * @throws NullPointerException if qname is null
+ * @throws NullPointerException if {@code qname} is {@code null}
*/
default Optional<ActionDefinition> findAction(final QName qname) {
requireNonNull(qname);
- for (ActionDefinition action : getActions()) {
+ for (var action : getActions()) {
if (qname.equals(action.getQName())) {
return Optional.of(action);
}
*/
package org.opendaylight.yangtools.yang.model.api;
-import com.google.common.annotations.Beta;
-
/**
* Trait interface for {@link SchemaNode}s, which have the {@link #isAddedByUses()} method.
*
* @deprecated The only user of this trait is MD-SAL's binding component. As such, we provide enough information in
* EffectiveStatement tree to reconstruct this information.
*/
-@Beta
@Deprecated(since = "7.0.9", forRemoval = true)
public interface AddedByUsesAware {
/**
*/
package org.opendaylight.yangtools.yang.model.api;
-import com.google.common.annotations.Beta;
import java.util.Optional;
import org.opendaylight.yangtools.yang.model.api.stmt.AnydataEffectiveStatement;
* model for anydata content to become known through protocol signaling or other means that are outside the scope
* of this document.
*/
-@Beta
public interface AnydataSchemaNode extends DataSchemaNode, MandatoryAware, MustConstraintAware,
EffectiveStatementEquivalent<AnydataEffectiveStatement> {
/**
*/
package org.opendaylight.yangtools.yang.model.api;
-import com.google.common.annotations.Beta;
-
/**
- * Common interface for common container-like constructs.
+ * Common interface for common container-like constructs. This includes {@link ContainerSchemaNode},
+ * {@link InputSchemaNode}, {@link OutputSchemaNode} and, for legacy reasons, {@link SchemaContext}.
*/
-@Beta
public interface ContainerLike extends DataNodeContainer,
AugmentationTarget, DataSchemaNode, NotificationNodeContainer, ActionNodeContainer, MustConstraintAware {
*/
package org.opendaylight.yangtools.yang.model.api;
-import com.google.common.annotations.Beta;
import org.eclipse.jdt.annotation.NonNull;
import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
*
* @param <E> Type of equivalent {@link EffectiveStatement}.
*/
-@Beta
public interface EffectiveStatementEquivalent<E extends EffectiveStatement<?, ?>> {
/**
* Return {@link EffectiveStatement} representation of this object.
*/
package org.opendaylight.yangtools.yang.model.api;
-import com.google.common.annotations.Beta;
import org.opendaylight.yangtools.yang.model.api.stmt.InputEffectiveStatement;
-@Beta
+/**
+ * An {@link InputSchemaNode} defines inputs of an {@link RpcDefinition} or an {@link ActionDefinition}.
+ */
public interface InputSchemaNode extends ContainerLike, EffectiveStatementEquivalent<InputEffectiveStatement> {
}
*/
package org.opendaylight.yangtools.yang.model.api;
-import com.google.common.annotations.Beta;
import java.util.Collection;
import org.eclipse.jdt.annotation.NonNull;
/**
- * Common interface for an operation.
+ * Common interface for an operation, such as an {@link RpcDefinition} or an {@link ActionDefinition}.
*/
-@Beta
public interface OperationDefinition extends SchemaNode {
/**
* Returns the set of type definitions declared under this operation.
* @return Definition of input parameters for this operation.
* The substatements of input define nodes under the operation's input node.
*/
- InputSchemaNode getInput();
+ @NonNull InputSchemaNode getInput();
/**
* Returns definition of output parameters for this operation.
* @return Definition of output parameters for this operation. The
* substatements of output define nodes under the operation's output node.
*/
- OutputSchemaNode getOutput();
+ @NonNull OutputSchemaNode getOutput();
}
*/
package org.opendaylight.yangtools.yang.model.api;
-import com.google.common.annotations.Beta;
import org.opendaylight.yangtools.yang.model.api.stmt.OutputEffectiveStatement;
-@Beta
+/**
+ * An {@link InputSchemaNode} defines outputs of an {@link RpcDefinition} or an {@link ActionDefinition}.
+ */
public interface OutputSchemaNode extends ContainerLike, EffectiveStatementEquivalent<OutputEffectiveStatement> {
}
import static java.util.Objects.requireNonNull;
-import com.google.common.annotations.Beta;
import com.google.common.base.MoreObjects;
import com.google.common.base.MoreObjects.ToStringHelper;
import org.eclipse.jdt.annotation.NonNullByDefault;
* Semantically a {@link PathExpression} is similar to a {@link YangXPathExpression} with guarantees around what
* subexpressions it can contain:
* <ul>
- * <li>the root expression must be a {@link YangLocationPath}</li>
- * <li>it can contain steps only along {@link YangXPathAxis#CHILD} and {@link YangXPathAxis#PARENT} axis</li>
- * <li>all steps along {@link YangXPathAxis#CHILD} axis are {@link QNameStep}</li>
- * <li>the only function invocation is {@link YangFunction#CURRENT}</li>
- * <li>only {@link YangBinaryOperator#EQUALS} is allowed</li>
- * <li>no literals nor numbers are allowed</li>
- * <li>all qualified node identifiers must me resolved</li>
+ * <li>the root expression must be a {@link YangLocationPath}</li>
+ * <li>it can contain steps only along {@link YangXPathAxis#CHILD} and {@link YangXPathAxis#PARENT} axis</li>
+ * <li>all steps along {@link YangXPathAxis#CHILD} axis are {@link QNameStep}</li>
+ * <li>the only function invocation is {@link YangFunction#CURRENT}</li>
+ * <li>only {@link YangBinaryOperator#EQUALS} is allowed</li>
+ * <li>no literals nor numbers are allowed</li>
+ * <li>all qualified node identifiers must me resolved</li>
* </ul>
- *
- * @author Robert Varga
*/
-@Beta
@NonNullByDefault
public interface PathExpression extends Immutable {
/**
* Abstract base class for expressing steps of a PathExpression.
*/
- abstract class Steps {
+ abstract sealed class Steps {
Steps() {
// Prevent external subclassing
}
@Override
public boolean equals(final @Nullable Object obj) {
- return this == obj
- || obj instanceof LocationPathSteps && locationPath.equals(((LocationPathSteps) obj).locationPath);
+ return this == obj || obj instanceof LocationPathSteps other && locationPath.equals(other.locationPath);
}
@Override
@Override
public boolean equals(@Nullable final Object obj) {
- if (this == obj) {
- return true;
- }
- if (!(obj instanceof DerefSteps)) {
- return false;
- }
- final DerefSteps other = (DerefSteps) obj;
- return derefArgument.equals(other.derefArgument) && relativePath.equals(other.relativePath);
+ return this == obj || obj instanceof DerefSteps other
+ && derefArgument.equals(other.derefArgument) && relativePath.equals(other.relativePath);
}
@Override
* @return <code>true</code> if the XPapth starts in root of YANG model, otherwise returns <code>false</code>
*/
default boolean isAbsolute() {
- final Steps steps = getSteps();
- return steps instanceof LocationPathSteps && ((LocationPathSteps) steps).getLocationPath().isAbsolute();
+ return getSteps() instanceof LocationPathSteps locationSteps && locationSteps.getLocationPath().isAbsolute();
}
}