From: Robert Varga Date: Fri, 24 Jul 2020 09:05:36 +0000 (+0200) Subject: Fixup yang-model-api javadoc warnings X-Git-Tag: v5.0.6~32 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F12%2F91612%2F1;p=yangtools.git Fixup yang-model-api javadoc warnings There are a number of issues javadoc is complaining about, fix them up. Change-Id: I82e108faca800b80a85e00aab96cb8ec8fdc91e6 Signed-off-by: Robert Varga --- diff --git a/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/SchemaContext.java b/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/SchemaContext.java index 1e64e5d532..c3a1d20dd3 100644 --- a/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/SchemaContext.java +++ b/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/SchemaContext.java @@ -301,6 +301,7 @@ public interface SchemaContext extends ContainerSchemaNode, Immutable { /** * Get identities derived from a selected identity. * + * @param identity base identity * @return collection of identities derived from this identity * @throws NullPointerException if identity is null * @throws IllegalArgumentException if the specified identity is not present in this context diff --git a/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/meta/DeclaredStatement.java b/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/meta/DeclaredStatement.java index ca2132e06b..94521207bc 100644 --- a/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/meta/DeclaredStatement.java +++ b/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/meta/DeclaredStatement.java @@ -42,12 +42,13 @@ public interface DeclaredStatement extends ModelStatement { * Returns collection of explicitly declared child statements, while preserving its original ordering from original * source. * + * @param substatement type * @param type {@link DeclaredStatement} type * @return Collection of statements, which were explicitly declared in source of model. * @throws NullPointerException if {@code type} is null */ - default > @NonNull Collection declaredSubstatements( - final Class type) { + default > @NonNull Collection declaredSubstatements( + final Class type) { requireNonNull(type); return Collections2.transform(Collections2.filter(declaredSubstatements(), type::isInstance), type::cast); } @@ -55,6 +56,7 @@ public interface DeclaredStatement extends ModelStatement { /** * Find the first effective substatement of specified type. * + * @param substatement type * @param type {@link DeclaredStatement} type * @return First declared substatement, or empty if no match is found. * @throws NullPointerException if {@code type} is null @@ -69,6 +71,9 @@ public interface DeclaredStatement extends ModelStatement { /** * Find the first declared substatement of specified type and return its value. * + * @param substatement type + * @param substatement argument type + * @param type {@link DeclaredStatement} type * @return First declared substatement's argument, or empty if no match is found. * @throws NullPointerException if {@code type} is null */ @@ -81,6 +86,8 @@ public interface DeclaredStatement extends ModelStatement { /** * Find all declared substatements of specified type and return them as a stream. * + * @param substatement type + * @param type {@link DeclaredStatement} type * @return A stream of all declared substatements of specified type. * @throws NullPointerException if {@code type} is null */ diff --git a/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/meta/EffectiveStatement.java b/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/meta/EffectiveStatement.java index 7a8ab021b6..b47a301dce 100644 --- a/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/meta/EffectiveStatement.java +++ b/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/meta/EffectiveStatement.java @@ -85,6 +85,8 @@ public interface EffectiveStatement> extends M /** * Find the first effective substatement of specified type. * + * @param substatement type + * @param type substatement type * @return First effective substatement, or empty if no match is found. */ @Beta @@ -95,6 +97,9 @@ public interface EffectiveStatement> extends M /** * Find the first effective substatement of specified type and return its value. * + * @param substatement type + * @param substatement argument type + * @param type substatement type * @return First effective substatement's argument, or empty if no match is found. */ @Beta @@ -106,6 +111,8 @@ public interface EffectiveStatement> extends M /** * Find all effective substatements of specified type and return them as a stream. * + * @param substatement type + * @param type substatement type * @return A stream of all effective substatements of specified type. */ @Beta diff --git a/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/stmt/DataTreeAwareEffectiveStatement.java b/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/stmt/DataTreeAwareEffectiveStatement.java index 782db09aca..455744a302 100644 --- a/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/stmt/DataTreeAwareEffectiveStatement.java +++ b/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/stmt/DataTreeAwareEffectiveStatement.java @@ -48,6 +48,7 @@ public interface DataTreeAwareEffectiveStatement Effective substatement type * @param qname Child identifier * @return Data tree child, or empty * @throws NullPointerException if {@code qname} is null diff --git a/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/stmt/SchemaTreeAwareEffectiveStatement.java b/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/stmt/SchemaTreeAwareEffectiveStatement.java index 6d845b7ef2..f5d6757b70 100644 --- a/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/stmt/SchemaTreeAwareEffectiveStatement.java +++ b/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/stmt/SchemaTreeAwareEffectiveStatement.java @@ -44,6 +44,7 @@ public interface SchemaTreeAwareEffectiveStatement Effective substatement type * @param qname Child identifier * @return Schema tree child, or empty * @throws NullPointerException if {@code qname} is null diff --git a/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/repo/api/RevisionSourceIdentifier.java b/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/repo/api/RevisionSourceIdentifier.java index 080155aaf4..cb1e8de901 100644 --- a/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/repo/api/RevisionSourceIdentifier.java +++ b/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/repo/api/RevisionSourceIdentifier.java @@ -75,6 +75,7 @@ public final class RevisionSourceIdentifier extends SourceIdentifier { * * @param moduleName Name of schema * @param revision Revision of source in format YYYY-mm-dd. If not present, default value will be used. + * @return A RevisionSourceIdentifier */ public static @NonNull RevisionSourceIdentifier create(final String moduleName, final Optional revision) { return new RevisionSourceIdentifier(moduleName, revision); @@ -85,6 +86,7 @@ public final class RevisionSourceIdentifier extends SourceIdentifier { * * @param moduleName Name of schema * @param revision Revision of source, may be null + * @return A RevisionSourceIdentifier */ public static @NonNull RevisionSourceIdentifier create(final String moduleName, final @Nullable Revision revision) { return new RevisionSourceIdentifier(moduleName, revision); @@ -94,8 +96,8 @@ public final class RevisionSourceIdentifier extends SourceIdentifier { * Creates new YANG Schema revision source identifier for sources without * a revision. * - * @param moduleName - * Name of schema + * @param moduleName Name of schema + * @return A RevisionSourceIdentifier */ public static @NonNull RevisionSourceIdentifier create(final String moduleName) { return new RevisionSourceIdentifier(moduleName); diff --git a/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/repo/api/SemVerSourceIdentifier.java b/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/repo/api/SemVerSourceIdentifier.java index a67f166ea2..d8a0dcaeb5 100644 --- a/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/repo/api/SemVerSourceIdentifier.java +++ b/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/repo/api/SemVerSourceIdentifier.java @@ -79,6 +79,7 @@ public final class SemVerSourceIdentifier extends SourceIdentifier { * * @param moduleName Name of schema * @param semVer semantic version of source + * @return A SemVerSourceIdentifier */ public static @NonNull SemVerSourceIdentifier create(final String moduleName, final SemVer semVer) { return new SemVerSourceIdentifier(moduleName, semVer); @@ -90,6 +91,7 @@ public final class SemVerSourceIdentifier extends SourceIdentifier { * @param moduleName Name of schema * @param revision Revision of source in format YYYY-mm-dd * @param semVer semantic version of source + * @return A SemVerSourceIdentifier */ public static @NonNull SemVerSourceIdentifier create(final String moduleName, final Revision revision, final SemVer semVer) { @@ -102,6 +104,7 @@ public final class SemVerSourceIdentifier extends SourceIdentifier { * @param moduleName Name of schema * @param revision Optional of source revision in format YYYY-mm-dd. If not present, default value will be used. * @param semVer semantic version of source + * @return A SemVerSourceIdentifier */ public static @NonNull SemVerSourceIdentifier create(final String moduleName, final Optional revision, final SemVer semVer) { diff --git a/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/repo/api/SourceIdentifier.java b/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/repo/api/SourceIdentifier.java index a6f7ba584c..b6cb99f726 100644 --- a/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/repo/api/SourceIdentifier.java +++ b/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/repo/api/SourceIdentifier.java @@ -121,15 +121,15 @@ public abstract class SourceIdentifier implements Identifier, Immutable { *

* See http://tools.ietf.org/html/rfc6020#section-5.2 * + * @param moduleName module name + * @param revision optional revision * @return Filename for this source identifier. */ public static @NonNull String toYangFileName(final String moduleName, final Optional revision) { - StringBuilder filename = new StringBuilder(moduleName); + final StringBuilder sb = new StringBuilder(moduleName); if (revision.isPresent()) { - filename.append('@'); - filename.append(revision.get()); + sb.append('@').append(revision.orElseThrow()); } - filename.append(YangConstants.RFC6020_YANG_FILE_EXTENSION); - return filename.toString(); + return sb.append(YangConstants.RFC6020_YANG_FILE_EXTENSION).toString(); } } diff --git a/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/repo/spi/SchemaSourceRegistry.java b/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/repo/spi/SchemaSourceRegistry.java index dfa34b79a4..ad034f5e27 100644 --- a/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/repo/spi/SchemaSourceRegistry.java +++ b/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/repo/spi/SchemaSourceRegistry.java @@ -12,35 +12,30 @@ import org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceRepresentation import org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier; /** - * Registry of all potentially available schema sources. Processes capable of - * dynamic schema discovery, such as OSGi registry scanners, NETCONF clients - * (with NETCONF monitoring extension) and similar can register - * {@link SchemaSourceProvider} instances which would then acquire the schema - * source. + * Registry of all potentially available schema sources. Processes capable of dynamic schema discovery, such as OSGi + * registry scanners, NETCONF clients (with NETCONF monitoring extension) and similar can register + * {@link SchemaSourceProvider} instances which would then acquire the schema source. */ @Beta public interface SchemaSourceRegistry { /** - * Register a new schema source which is potentially available from a provider. - * A registration does not guarantee that a subsequent call to - * {@link SchemaSourceProvider#getSource(SourceIdentifier)} will succeed. + * Register a new schema source which is potentially available from a provider. A registration does not guarantee + * that a subsequent call to {@link SchemaSourceProvider#getSource(SourceIdentifier)} will succeed. * + * @param schema source representation type * @param provider Resolver which can potentially resolve the identifier * @param source Schema source details - * @return A registration handle. Invoking {@link SchemaSourceRegistration#close()} - * will cancel the registration. + * @return A registration handle. Invoking {@link SchemaSourceRegistration#close()} will cancel the registration. */ SchemaSourceRegistration registerSchemaSource( SchemaSourceProvider provider, PotentialSchemaSource source); /** - * Register a schema source listener. The listener will be notified as new - * sources and their representations become available, subject to the provided - * filter. + * Register a schema source listener. The listener will be notified as new sources and their representations become + * available, subject to the provided filter. * * @param listener Schema source listener - * @return A registration handle. Invoking {@link SchemaListenerRegistration#close()} - * will cancel the registration. + * @return A registration handle. Invoking {@link SchemaListenerRegistration#close()} will cancel the registration. */ SchemaListenerRegistration registerSchemaSourceListener(SchemaSourceListener listener); }