Fixup yang-model-api javadoc warnings 12/91612/1
authorRobert Varga <robert.varga@pantheon.tech>
Fri, 24 Jul 2020 09:05:36 +0000 (11:05 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Fri, 24 Jul 2020 09:06:04 +0000 (11:06 +0200)
There are a number of issues javadoc is complaining about, fix them
up.

Change-Id: I82e108faca800b80a85e00aab96cb8ec8fdc91e6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/SchemaContext.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/meta/DeclaredStatement.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/meta/EffectiveStatement.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/stmt/DataTreeAwareEffectiveStatement.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/stmt/SchemaTreeAwareEffectiveStatement.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/repo/api/RevisionSourceIdentifier.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/repo/api/SemVerSourceIdentifier.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/repo/api/SourceIdentifier.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/repo/spi/SchemaSourceRegistry.java

index 1e64e5d532aedbc4d09a79e663e3984b08ce8c57..c3a1d20dd32655d89f637f65bd19a788c64b6f9a 100644 (file)
@@ -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
index ca2132e06b47f5016af6dc8e987a051d857c17b9..94521207bcf6cec73fb2dab7b437955f52b90708 100644 (file)
@@ -42,12 +42,13 @@ public interface DeclaredStatement<A> extends ModelStatement<A> {
      * Returns collection of explicitly declared child statements, while preserving its original ordering from original
      * source.
      *
+     * @param <T> 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 <S extends DeclaredStatement<?>> @NonNull Collection<? extends S> declaredSubstatements(
-            final Class<S> type) {
+    default <T extends DeclaredStatement<?>> @NonNull Collection<? extends T> declaredSubstatements(
+            final Class<T> type) {
         requireNonNull(type);
         return Collections2.transform(Collections2.filter(declaredSubstatements(), type::isInstance), type::cast);
     }
@@ -55,6 +56,7 @@ public interface DeclaredStatement<A> extends ModelStatement<A> {
     /**
      * Find the first effective substatement of specified type.
      *
+     * @param <T> 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<A> extends ModelStatement<A> {
     /**
      * Find the first declared substatement of specified type and return its value.
      *
+     * @param <T> substatement type
+     * @param <V> 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<A> extends ModelStatement<A> {
     /**
      * Find all declared substatements of specified type and return them as a stream.
      *
+     * @param <T> substatement type
+     * @param type {@link DeclaredStatement} type
      * @return A stream of all declared substatements of specified type.
      * @throws NullPointerException if {@code type} is null
      */
index 7a8ab021b6c44fdf68e6564265130efc43bd1d3a..b47a301dce203c4c3cf98495cd5d7ff3429b9716 100644 (file)
@@ -85,6 +85,8 @@ public interface EffectiveStatement<A, D extends DeclaredStatement<A>> extends M
     /**
      * Find the first effective substatement of specified type.
      *
+     * @param <T> 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<A, D extends DeclaredStatement<A>> extends M
     /**
      * Find the first effective substatement of specified type and return its value.
      *
+     * @param <T> substatement type
+     * @param <V> 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<A, D extends DeclaredStatement<A>> extends M
     /**
      * Find all effective substatements of specified type and return them as a stream.
      *
+     * @param <T> substatement type
+     * @param type substatement type
      * @return A stream of all effective substatements of specified type.
      */
     @Beta
index 782db09acac77493121d673dc3d4fe7816286698..455744a302d3c6076e57c5bc1a37e92f75bb770d 100644 (file)
@@ -48,6 +48,7 @@ public interface DataTreeAwareEffectiveStatement<A, D extends DeclaredStatement<
     /**
      * Find a {@code data tree} child {@link DataTreeEffectiveStatement}, as identified by its QName argument.
      *
+     * @param <E> Effective substatement type
      * @param qname Child identifier
      * @return Data tree child, or empty
      * @throws NullPointerException if {@code qname} is null
index 6d845b7ef213400fcedde257c38082aa25ec07f3..f5d6757b7031a5e1779a19ddd97eb262f47afb08 100644 (file)
@@ -44,6 +44,7 @@ public interface SchemaTreeAwareEffectiveStatement<A, D extends DeclaredStatemen
     /**
      * Find a {@code schema tree} child {@link SchemaTreeEffectiveStatement}, as identified by its QName argument.
      *
+     * @param <E> Effective substatement type
      * @param qname Child identifier
      * @return Schema tree child, or empty
      * @throws NullPointerException if {@code qname} is null
index 080155aaf46bbee5ee85d1baf653d8a11a1d4e10..cb1e8de90179a7b78d15c008866bf9655104db78 100644 (file)
@@ -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> 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);
index a67f166ea2342a55373ea512272349075084a01c..d8a0dcaeb50467d6bd162f5e200277c382337680 100644 (file)
@@ -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> revision,
             final SemVer semVer) {
index a6f7ba584c797e3afa9aa560d5a2c348d4c1ac51..b6cb99f726fd4746def17562aed253c9e5267902 100644 (file)
@@ -121,15 +121,15 @@ public abstract class SourceIdentifier implements Identifier, Immutable {
      * <p>
      * 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> 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();
     }
 }
index dfa34b79a4547b637b26a21481ad512e198fc3f6..ad034f5e271093fba56f77c17ea9cc0a66818e75 100644 (file)
@@ -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 <T> 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.
      */
     <T extends SchemaSourceRepresentation> SchemaSourceRegistration<T> registerSchemaSource(
             SchemaSourceProvider<? super T> provider, PotentialSchemaSource<T> 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);
 }