You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ra...@apache.org on 2021/05/18 13:04:15 UTC

[sling-org-apache-sling-graphql-core] branch master updated: SLING-10385 - JavaDocs cannot be generated with Java 11

This is an automated email from the ASF dual-hosted git repository.

radu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-graphql-core.git


The following commit(s) were added to refs/heads/master by this push:
     new 33ccb29  SLING-10385 - JavaDocs cannot be generated with Java 11
33ccb29 is described below

commit 33ccb29666118e01f3c6abbf8810871190100c58
Author: Radu Cotescu <ra...@apache.org>
AuthorDate: Tue May 18 15:03:55 2021 +0200

    SLING-10385 - JavaDocs cannot be generated with Java 11
    
    * corrected JavaDocs
---
 pom.xml                                            |  2 +-
 .../org/apache/sling/graphql/api/SelectionSet.java | 14 +++++--
 .../sling/graphql/api/SlingGraphQLException.java   |  5 +++
 .../core/helpers/pagination/GenericConnection.java | 46 +++++++++++++++-------
 4 files changed, 48 insertions(+), 19 deletions(-)

diff --git a/pom.xml b/pom.xml
index 48a1e7e..c74eeed 100644
--- a/pom.xml
+++ b/pom.xml
@@ -37,8 +37,8 @@
   <properties>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
-
     <org.ops4j.pax.exam.version>4.13.3</org.ops4j.pax.exam.version>
+    <site.javadoc.exclude>org.apache.sling.graphql.core.*</site.javadoc.exclude>
     <!-- additional options that can be passed to Pax before executing the tests -->
     <pax.vm.options />
   </properties>
diff --git a/src/main/java/org/apache/sling/graphql/api/SelectionSet.java b/src/main/java/org/apache/sling/graphql/api/SelectionSet.java
index ccfa765..19c8a7d 100644
--- a/src/main/java/org/apache/sling/graphql/api/SelectionSet.java
+++ b/src/main/java/org/apache/sling/graphql/api/SelectionSet.java
@@ -18,12 +18,12 @@
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
 package org.apache.sling.graphql.api;
 
+import java.util.List;
+
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 import org.osgi.annotation.versioning.ProviderType;
 
-import java.util.List;
-
 /**
  * Interface to wrap information from <a href="https://javadoc.io/doc/com.graphql-java/graphql-java/latest/graphql/schema/DataFetchingFieldSelectionSet.html">GraphQL DataFetchingFieldSelectionSet</a>.
  * <p>Mainly it keeps information about fields name that got selected.</p>
@@ -59,18 +59,26 @@ import java.util.List;
 public interface SelectionSet {
 
     /**
+     * Returns a list of the immediate fields in the selection.
+     *
      * @return the immediate list of fields in the selection.
      */
     @NotNull
     List<SelectedField> getFields();
 
     /**
+     * Returns {@code true} if the selection set contains the field identified by {@code qualifiedName}.
+     *
+     * @param qualifiedName the qualified name of the field
      * @return true if the field qualified name exist.
      */
     boolean contains(String qualifiedName);
 
     /**
-     * @return SelectedField for qualified name.
+     * Returns the fields identified by {@code qualifiedName} or {@code null}.
+     *
+     * @param qualifiedName the qualified name of the field
+     * @return the {@link SelectedField} for the passed {@code qualifiedName} or {@code null}
      */
     @Nullable
     SelectedField get(String qualifiedName);
diff --git a/src/main/java/org/apache/sling/graphql/api/SlingGraphQLException.java b/src/main/java/org/apache/sling/graphql/api/SlingGraphQLException.java
index d447ba2..8018103 100644
--- a/src/main/java/org/apache/sling/graphql/api/SlingGraphQLException.java
+++ b/src/main/java/org/apache/sling/graphql/api/SlingGraphQLException.java
@@ -28,6 +28,8 @@ public class SlingGraphQLException extends RuntimeException {
 
     /**
      * Creates a {@code SlingGraphQLException} without a known cause.
+     *
+     * @param message the exception's message
      */
     public SlingGraphQLException(String message) {
         this(message, null);
@@ -35,6 +37,9 @@ public class SlingGraphQLException extends RuntimeException {
 
     /**
      * Creates a {@code SlingGraphQLException} with a known cause.
+     *
+     * @param message the exception's message
+     * @param cause   the cause of this exception
      */
     public SlingGraphQLException(String message, Throwable cause) {
         super(message, cause);
diff --git a/src/main/java/org/apache/sling/graphql/core/helpers/pagination/GenericConnection.java b/src/main/java/org/apache/sling/graphql/core/helpers/pagination/GenericConnection.java
index 5d103fd..53ccc7f 100644
--- a/src/main/java/org/apache/sling/graphql/core/helpers/pagination/GenericConnection.java
+++ b/src/main/java/org/apache/sling/graphql/core/helpers/pagination/GenericConnection.java
@@ -17,7 +17,7 @@
  * under the License.
  */
 
- package org.apache.sling.graphql.core.helpers.pagination;
+package org.apache.sling.graphql.core.helpers.pagination;
 
 import java.util.ArrayList;
 import java.util.Iterator;
@@ -35,11 +35,11 @@ import org.osgi.annotation.versioning.ConsumerType;
 
 /** As per https://relay.dev/graphql/connections.htm a "connection"
  *  is a page of results for a paginated query.
- * 
+ *
  *  Use the {@link Builder} class to build a Connection that outputs
  *  the supplied data, optionally sliced based on a "start after" cursor
  *  and a limit on the number of items output.
-*/
+ */
 @ConsumerType
 public final class GenericConnection<T> implements Connection<T>, PageInfo {
 
@@ -177,17 +177,20 @@ public final class GenericConnection<T> implements Connection<T>, PageInfo {
 
         /** Builder for a Connection that will output the supplied data, optionally skipping items
          *  at the beginning and considering a set maximum of items.
-         * 
+         *
          *  @param dataIterator the connection's data - must include the item that startAfter points to if that
-         *      Cursor is set, but can contain less items that set by the "limit" parameter.          
+         *      Cursor is set, but can contain less items that set by the "limit" parameter.
          *  @param cursorStringProvider extracts a String from an object of type T to create a Cursor
-        */
+         */
         public Builder(@NotNull Iterator<T> dataIterator, @NotNull Function<T, String> cursorStringProvider) {
             connection = new GenericConnection<>(dataIterator, cursorStringProvider);
         }
 
-        /** Set a limit on the number of items returned by the connection.
-         * @param limit must be <= MAX_LIMIT
+        /**
+         * Set a limit on the number of items returned by the connection.
+         *
+         * @param limit must be &lt;= MAX_LIMIT
+         * @return this builder
          */
         public Builder<T> withLimit(int limit) {
             if(limit < 0) {
@@ -200,31 +203,44 @@ public final class GenericConnection<T> implements Connection<T>, PageInfo {
             return this;
         }
 
-        /** If set, the connection will skip to the first item after
-         *  this Cursor.
+        /**
+         * If set, the connection will skip to the first item after the {@code c} {@link Cursor}.
+         *
+         * @param c the cursor for {@code startAfter}
+         * @return this builder
          */
         public Builder<T> withStartAfter(@Nullable Cursor c) {
             connection.startAfter = c;
             return this;
         }
 
-        /** Force the "has previous page" value, in case the supplied
-         *  data doesn't expose that but a new query would find it
+        /**
+         * Force the "has previous page" value, in case the supplied data doesn't expose that but a new query would find it.
+         *
+         * @param b a {@code boolean} that can force the {@code hasPreviousPage}
+         * @return this builder
          */
         public Builder<T> withPreviousPage(boolean b) {
             connection.hasPreviousPage = b;
             return this;
         }
 
-        /** Force the "has next page" value, in case the supplied
-         *  data doesn't expose that but a new query would find it
+        /**
+         * Force the "has next page" value, in case the supplied data doesn't expose that but a new query would find it
+         *
+         * @param b a {@code boolean} that can force the {@code hasNextPage}
+         * @return this builder
          */
         public Builder<T> withNextPage(boolean b) {
             connection.hasNextPage = b;
             return this;
         }
 
-        /** Build the Connection - can only be called once */
+        /**
+         * Build the Connection - can only be called once.
+         *
+         * @return a {@link Connection}
+         */
         public Connection<T> build() {
             connection.initialize();
             return connection;