Skip to content

Commit b27eb5c

Browse files
committed
Minor javadoc fixes
1 parent 54596c0 commit b27eb5c

File tree

6 files changed

+19
-16
lines changed

6 files changed

+19
-16
lines changed

gcloud-java-core/src/main/java/com/google/cloud/AsyncPage.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,16 @@
3737
* for (T value : page.values()) {
3838
* // do something with value
3939
* }
40-
* page = page.nextPage().get();
40+
* page = page.nextPageAsync().get();
4141
* }}</pre>
4242
*
4343
* @param <T> the value type that the page holds
4444
*/
4545
public interface AsyncPage<T> extends Page<T> {
4646

4747
/**
48-
* Returns a {@link Future} object for the next page.
48+
* Returns a {@link Future} object for the next page. {@link Future#get()} returns {@code null} if
49+
* the last page has been reached.
4950
*/
5051
Future<AsyncPage<T>> nextPageAsync();
5152
}

gcloud-java-core/src/main/java/com/google/cloud/AsyncPageImpl.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package com.google.cloud;
1818

1919
import com.google.common.base.Throwables;
20+
import com.google.common.util.concurrent.Futures;
2021
import com.google.common.util.concurrent.Uninterruptibles;
2122

2223
import java.io.Serializable;
@@ -47,7 +48,7 @@ private static class SyncNextPageFetcher<T> implements PageImpl.NextPageFetcher<
4748

4849
private static final long serialVersionUID = -4124568632363525351L;
4950

50-
private NextPageFetcher<T> asyncPageFetcher;
51+
private final NextPageFetcher<T> asyncPageFetcher;
5152

5253
private SyncNextPageFetcher(NextPageFetcher<T> asyncPageFetcher) {
5354
this.asyncPageFetcher = asyncPageFetcher;
@@ -75,7 +76,7 @@ public AsyncPageImpl(NextPageFetcher<T> asyncPageFetcher, String cursor, Iterabl
7576
@Override
7677
public Future<AsyncPage<T>> nextPageAsync() {
7778
if (nextPageCursor() == null || asyncPageFetcher == null) {
78-
return null;
79+
return Futures.immediateCheckedFuture(null);
7980
}
8081
return asyncPageFetcher.nextPage();
8182
}

gcloud-java-pubsub/src/main/java/com/google/cloud/pubsub/SubscriptionId.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
/**
2929
* Identity for a Google PubSub subscription. {@code SubscriptionId} objects are returned by the
3030
* {@link PubSub#listSubscriptions(String, PubSub.ListOption...)} and
31-
* {@link PubSub#listSubscriptionsAsync(String, PubSub.ListOption...)} methods as the same topic
32-
* can be used by subscriptions in different projects.
31+
* {@link PubSub#listSubscriptionsAsync(String, PubSub.ListOption...)} methods as a topic may have
32+
* subscriptions from different projects.
3333
*/
3434
public class SubscriptionId implements Serializable {
3535

gcloud-java-pubsub/src/main/java/com/google/cloud/pubsub/SubscriptionInfo.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ public Builder toBuilder() {
291291
* letters ({@code [A-Za-z]}), numbers ({@code [0-9]}), dashes ({@code -}), underscores
292292
* ({@code _}), periods ({@code .}), tildes ({@code ~}), plus ({@code +}) or percent signs
293293
* ({@code %}). It must be between 3 and 255 characters in length and cannot begin with the
294-
* string {@code goog}
294+
* string {@code goog}.
295295
*/
296296
public static SubscriptionInfo of(String topic, String name) {
297297
return builder(topic, name).build();
@@ -307,7 +307,7 @@ public static SubscriptionInfo of(String topic, String name) {
307307
* letters ({@code [A-Za-z]}), numbers ({@code [0-9]}), dashes ({@code -}), underscores
308308
* ({@code _}), periods ({@code .}), tildes ({@code ~}), plus ({@code +}) or percent signs
309309
* ({@code %}). It must be between 3 and 255 characters in length and cannot begin with the
310-
* string {@code goog}
310+
* string {@code goog}.
311311
*/
312312
public static SubscriptionInfo of(TopicId topic, String name) {
313313
return builder(topic, name).build();
@@ -323,7 +323,7 @@ public static SubscriptionInfo of(TopicId topic, String name) {
323323
* letters ({@code [A-Za-z]}), numbers ({@code [0-9]}), dashes ({@code -}), underscores
324324
* ({@code _}), periods ({@code .}), tildes ({@code ~}), plus ({@code +}) or percent signs
325325
* ({@code %}). It must be between 3 and 255 characters in length and cannot begin with the
326-
* string {@code goog}
326+
* string {@code goog}.
327327
* @param endpoint a URL locating the endpoint to which messages should be pushed. For example,
328328
* an endpoint might use {@code https://example.com/push}.
329329
*/
@@ -341,7 +341,7 @@ public static SubscriptionInfo of(String topic, String name, String endpoint) {
341341
* letters ({@code [A-Za-z]}), numbers ({@code [0-9]}), dashes ({@code -}), underscores
342342
* ({@code _}), periods ({@code .}), tildes ({@code ~}), plus ({@code +}) or percent signs
343343
* ({@code %}). It must be between 3 and 255 characters in length and cannot begin with the
344-
* string {@code goog}
344+
* string {@code goog}.
345345
* @param endpoint a URL locating the endpoint to which messages should be pushed. For example,
346346
* an endpoint might use {@code https://example.com/push}.
347347
*/
@@ -359,7 +359,7 @@ public static SubscriptionInfo of(TopicId topic, String name, String endpoint) {
359359
* letters ({@code [A-Za-z]}), numbers ({@code [0-9]}), dashes ({@code -}), underscores
360360
* ({@code _}), periods ({@code .}), tildes ({@code ~}), plus ({@code +}) or percent signs
361361
* ({@code %}). It must be between 3 and 255 characters in length and cannot begin with the
362-
* string {@code goog}
362+
* string {@code goog}.
363363
*/
364364
public static Builder builder(String topic, String name) {
365365
return builder(TopicId.of(topic), name);
@@ -375,7 +375,7 @@ public static Builder builder(String topic, String name) {
375375
* letters ({@code [A-Za-z]}), numbers ({@code [0-9]}), dashes ({@code -}), underscores
376376
* ({@code _}), periods ({@code .}), tildes ({@code ~}), plus ({@code +}) or percent signs
377377
* ({@code %}). It must be between 3 and 255 characters in length and cannot begin with the
378-
* string {@code goog}
378+
* string {@code goog}.
379379
*/
380380
public static Builder builder(TopicId topic, String name) {
381381
return new BuilderImpl(topic, name);

gcloud-java-pubsub/src/main/java/com/google/cloud/pubsub/TopicId.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
/**
3030
* Identity for a Google PubSub topic. A {@code TopicId} object can be used to create subscriptions
31-
* for topics, possibly residing on a different project.
31+
* for topics that possibly reside in different projects.
3232
*/
3333
public final class TopicId implements Serializable {
3434

@@ -43,7 +43,8 @@ private TopicId(String project, String topic) {
4343
}
4444

4545
/**
46-
* Returns the name of the project where the topic resides.
46+
* Returns the name of the project where the topic resides. If {@code null} the topic is assumed
47+
* to reside in the {@link PubSubOptions#projectId()} project.
4748
*/
4849
public String project() {
4950
return project;

gcloud-java-pubsub/src/main/java/com/google/cloud/pubsub/TopicInfo.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ public Builder toBuilder() {
140140
* ({@code [A-Za-z]}), numbers ({@code [0-9]}), dashes ({@code -}), underscores ({@code _}),
141141
* periods ({@code .}), tildes ({@code ~}), plus ({@code +}) or percent signs ({@code %}).
142142
* It must be between 3 and 255 characters in length and cannot begin with the string
143-
* {@code goog}
143+
* {@code goog}.
144144
*/
145145
public static TopicInfo of(String name) {
146146
return builder(name).build();
@@ -153,7 +153,7 @@ public static TopicInfo of(String name) {
153153
* ({@code [A-Za-z]}), numbers ({@code [0-9]}), dashes ({@code -}), underscores ({@code _}),
154154
* periods ({@code .}), tildes ({@code ~}), plus ({@code +}) or percent signs ({@code %}).
155155
* It must be between 3 and 255 characters in length and cannot begin with the string
156-
* {@code goog}
156+
* {@code goog}.
157157
*/
158158
public static Builder builder(String name) {
159159
return new BuilderImpl(name);

0 commit comments

Comments
 (0)