If a method has default {@link com.google.api.gax.retrying.RetrySettings}, the max attempts * and/or total timeout is still respected when scheduling each RPC attempt. */ - ApiCallContext withTimeoutDuration(@Nullable java.time.Duration timeout); + ApiCallContext withTimeoutDuration(java.time.@Nullable Duration timeout); /** This method is obsolete. Use {@link #getTimeoutDuration()} instead. */ - @Nullable @ObsoleteApi("Use getTimeoutDuration() instead") - org.threeten.bp.Duration getTimeout(); + org.threeten.bp.@Nullable Duration getTimeout(); /** Returns the configured per-RPC timeout. */ - @Nullable - java.time.Duration getTimeoutDuration(); + java.time.@Nullable Duration getTimeoutDuration(); /** * This method is obsolete. Use {@link #withStreamWaitTimeoutDuration(java.time.Duration)} * instead. */ @ObsoleteApi("Use withStreamWaitTimeoutDuration(java.time.Duration) instead") - ApiCallContext withStreamWaitTimeout(@Nullable org.threeten.bp.Duration streamWaitTimeout); + ApiCallContext withStreamWaitTimeout(org.threeten.bp.@Nullable Duration streamWaitTimeout); /** * Returns a new ApiCallContext with the given stream timeout set. @@ -117,27 +115,25 @@ public interface ApiCallContext extends RetryingContext { *
Please note that this timeout is best effort and the maximum resolution is configured in * {@link StubSettings#getStreamWatchdogCheckIntervalDuration()}. */ - ApiCallContext withStreamWaitTimeoutDuration(@Nullable java.time.Duration streamWaitTimeout); + ApiCallContext withStreamWaitTimeoutDuration(java.time.@Nullable Duration streamWaitTimeout); /** This method is obsolete. Use {@link #getStreamWaitTimeoutDuration()} instead. */ - @Nullable @ObsoleteApi("Use getStreamWaitTimeoutDuration() instead") - org.threeten.bp.Duration getStreamWaitTimeout(); + org.threeten.bp.@Nullable Duration getStreamWaitTimeout(); /** * Return the stream wait timeout set for this context. * * @see #withStreamWaitTimeoutDuration(java.time.Duration) */ - @Nullable - java.time.Duration getStreamWaitTimeoutDuration(); + java.time.@Nullable Duration getStreamWaitTimeoutDuration(); /** * This method is obsolete. Use {@link #withStreamIdleTimeoutDuration(java.time.Duration)} * instead. */ @ObsoleteApi("Use withStreamIdleTimeoutDuration(java.time.Duration) instead") - ApiCallContext withStreamIdleTimeout(@Nullable org.threeten.bp.Duration streamIdleTimeout); + ApiCallContext withStreamIdleTimeout(org.threeten.bp.@Nullable Duration streamIdleTimeout); /** * Returns a new ApiCallContext with the given stream idle timeout set. @@ -157,20 +153,19 @@ public interface ApiCallContext extends RetryingContext { *
Please note that this timeout is best effort and the maximum resolution is configured in
* {@link StubSettings#getStreamWatchdogCheckIntervalDuration()}.
*/
- ApiCallContext withStreamIdleTimeoutDuration(@Nullable java.time.Duration streamIdleTimeout);
+ ApiCallContext withStreamIdleTimeoutDuration(java.time.@Nullable Duration streamIdleTimeout);
/** This method is obsolete. Use {@link #getStreamIdleTimeoutDuration()} instead. */
- @Nullable
@ObsoleteApi("Use getStreamIdleTimeoutDuration() instead")
- org.threeten.bp.Duration getStreamIdleTimeout();
+ org.threeten.bp.@Nullable Duration getStreamIdleTimeout();
/**
* The stream idle timeout set for this context.
*
* @see #withStreamIdleTimeoutDuration(java.time.Duration)
*/
- @Nullable
- java.time.Duration getStreamIdleTimeoutDuration();
+ java.time.@Nullable Duration getStreamIdleTimeoutDuration();
+
/**
* The {@link ApiTracer} that was previously set for this context.
*
@@ -178,7 +173,7 @@ public interface ApiCallContext extends RetryingContext {
* events like retries.
*/
@BetaApi("The surface for tracing is not stable yet and may change in the future")
- @Nonnull
+ @NonNull
ApiTracer getTracer();
/**
@@ -190,7 +185,7 @@ public interface ApiCallContext extends RetryingContext {
* @param tracer the {@link ApiTracer} to set.
*/
@BetaApi("The surface for tracing is not stable yet and may change in the future")
- ApiCallContext withTracer(@Nonnull ApiTracer tracer);
+ ApiCallContext withTracer(@NonNull ApiTracer tracer);
/**
* Returns a new ApiCallContext with the given {@link RetrySettings} set.
diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/ClientContext.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/ClientContext.java
index 5bce1ac6bb..673e40ffcd 100644
--- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/ClientContext.java
+++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/ClientContext.java
@@ -61,8 +61,8 @@
import java.util.Set;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
+import org.jspecify.annotations.NonNull;
+import org.jspecify.annotations.Nullable;
/**
* Encapsulates client state, including executor, credentials, and transport channel.
@@ -104,14 +104,12 @@ public abstract class ClientContext {
public abstract Watchdog getStreamWatchdog();
/** This method is obsolete. Use {@link #getStreamWatchdogCheckIntervalDuration()} instead. */
- @Nonnull
@ObsoleteApi("Use getStreamWatchdogCheckIntervalDuration() instead")
- public final org.threeten.bp.Duration getStreamWatchdogCheckInterval() {
+ public final org.threeten.bp.@NonNull Duration getStreamWatchdogCheckInterval() {
return toThreetenDuration(getStreamWatchdogCheckIntervalDuration());
}
- @Nonnull
- public abstract java.time.Duration getStreamWatchdogCheckIntervalDuration();
+ public abstract java.time.@NonNull Duration getStreamWatchdogCheckIntervalDuration();
@Nullable
public abstract String getUniverseDomain();
@@ -127,7 +125,7 @@ public final org.threeten.bp.Duration getStreamWatchdogCheckInterval() {
/** Gets the {@link ApiTracerFactory} that will be used to generate traces for operations. */
@BetaApi("The surface for tracing is not stable yet and may change in the future.")
- @Nonnull
+ @NonNull
public abstract ApiTracerFactory getTracerFactory();
/**
diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/ClientSettings.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/ClientSettings.java
index 234fd4d19d..90c972df7a 100644
--- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/ClientSettings.java
+++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/ClientSettings.java
@@ -39,8 +39,8 @@
import com.google.common.base.MoreObjects;
import java.io.IOException;
import java.util.concurrent.Executor;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
+import org.jspecify.annotations.NonNull;
+import org.jspecify.annotations.Nullable;
/**
* A base settings class to configure a client class.
@@ -118,14 +118,12 @@ public final String getApiKey() {
}
/** This method is obsolete. Use {@link #getWatchdogCheckIntervalDuration()} instead. */
- @Nonnull
@ObsoleteApi("Use getWatchdogCheckIntervalDuration() instead")
- public final org.threeten.bp.Duration getWatchdogCheckInterval() {
+ public final org.threeten.bp.@NonNull Duration getWatchdogCheckInterval() {
return stubSettings.getStreamWatchdogCheckInterval();
}
- @Nonnull
- public final java.time.Duration getWatchdogCheckIntervalDuration() {
+ public final java.time.@NonNull Duration getWatchdogCheckIntervalDuration() {
return stubSettings.getStreamWatchdogCheckIntervalDuration();
}
@@ -287,11 +285,11 @@ public B setWatchdogProvider(@Nullable WatchdogProvider watchdogProvider) {
* instead.
*/
@ObsoleteApi("Use setWatchdogCheckIntervalDuration(java.time.Duration) instead")
- public B setWatchdogCheckInterval(@Nullable org.threeten.bp.Duration checkInterval) {
+ public B setWatchdogCheckInterval(org.threeten.bp.@Nullable Duration checkInterval) {
return setWatchdogCheckIntervalDuration(toJavaTimeDuration(checkInterval));
}
- public B setWatchdogCheckIntervalDuration(@Nullable java.time.Duration checkInterval) {
+ public B setWatchdogCheckIntervalDuration(java.time.@Nullable Duration checkInterval) {
stubSettings.setStreamWatchdogCheckIntervalDuration(checkInterval);
return self();
}
@@ -391,14 +389,12 @@ public String getApiKey() {
}
/** This method is obsolete. Use {@link #getWatchdogCheckIntervalDuration()} instead */
- @Nullable
@ObsoleteApi("Use getWatchdogCheckIntervalDuration() instead")
- public org.threeten.bp.Duration getWatchdogCheckInterval() {
+ public org.threeten.bp.@Nullable Duration getWatchdogCheckInterval() {
return stubSettings.getStreamWatchdogCheckInterval();
}
- @Nullable
- public java.time.Duration getWatchdogCheckIntervalDuration() {
+ public java.time.@Nullable Duration getWatchdogCheckIntervalDuration() {
return stubSettings.getStreamWatchdogCheckIntervalDuration();
}
diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/EndpointContext.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/EndpointContext.java
index dd6c199b35..7c85b6b281 100644
--- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/EndpointContext.java
+++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/EndpointContext.java
@@ -37,7 +37,7 @@
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Strings;
import java.io.IOException;
-import javax.annotation.Nullable;
+import org.jspecify.annotations.Nullable;
/**
* EndpointContext is an internal class used by the client library to resolve the endpoint. It is
@@ -62,7 +62,9 @@ public abstract class EndpointContext {
public static final String GOOGLE_CLOUD_UNIVERSE_DOMAIN = "GOOGLE_CLOUD_UNIVERSE_DOMAIN";
public static final String INVALID_UNIVERSE_DOMAIN_ERROR_TEMPLATE =
- "The configured universe domain (%s) does not match the universe domain found in the credentials (%s). If you haven't configured the universe domain explicitly, `googleapis.com` is the default.";
+ "The configured universe domain (%s) does not match the universe domain found in the"
+ + " credentials (%s). If you haven't configured the universe domain explicitly,"
+ + " `googleapis.com` is the default.";
public static final String UNABLE_TO_RETRIEVE_CREDENTIALS_ERROR_MESSAGE =
"Unable to retrieve the Universe Domain from the Credentials.";
diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/ErrorDetails.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/ErrorDetails.java
index 45ba427b6e..b7d799577f 100644
--- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/ErrorDetails.java
+++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/ErrorDetails.java
@@ -45,7 +45,7 @@
import com.google.rpc.ResourceInfo;
import com.google.rpc.RetryInfo;
import java.util.List;
-import javax.annotation.Nullable;
+import org.jspecify.annotations.Nullable;
/** This class contains a list of standard error messages that returns from server. */
@AutoValue
diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/FixedHeaderProvider.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/FixedHeaderProvider.java
index 8aa7816972..e023b4420f 100644
--- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/FixedHeaderProvider.java
+++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/FixedHeaderProvider.java
@@ -36,7 +36,7 @@
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
-import javax.annotation.Nullable;
+import org.jspecify.annotations.Nullable;
/** An instance of HeaderProvider that always provides the same headers. */
@AutoValue
diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/FixedWatchdogProvider.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/FixedWatchdogProvider.java
index 170e820c03..ead51b317c 100644
--- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/FixedWatchdogProvider.java
+++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/FixedWatchdogProvider.java
@@ -34,8 +34,8 @@
import com.google.api.core.ObsoleteApi;
import java.time.Duration;
import java.util.concurrent.ScheduledExecutorService;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
+import org.jspecify.annotations.NonNull;
+import org.jspecify.annotations.Nullable;
/**
* A watchdog provider which always returns the same watchdog instance provided to the provider
@@ -62,7 +62,7 @@ public boolean needsClock() {
}
@Override
- public WatchdogProvider withClock(@Nonnull ApiClock clock) {
+ public WatchdogProvider withClock(@NonNull ApiClock clock) {
throw new UnsupportedOperationException("FixedWatchdogProvider doesn't need a clock");
}
diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/InstantiatingWatchdogProvider.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/InstantiatingWatchdogProvider.java
index 5b06f882a3..1fa3beb4e9 100644
--- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/InstantiatingWatchdogProvider.java
+++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/InstantiatingWatchdogProvider.java
@@ -36,8 +36,8 @@
import com.google.api.core.ObsoleteApi;
import com.google.common.base.Preconditions;
import java.util.concurrent.ScheduledExecutorService;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
+import org.jspecify.annotations.NonNull;
+import org.jspecify.annotations.Nullable;
/**
* A watchdog provider which instantiates a new provider on every request.
@@ -49,7 +49,7 @@
public final class InstantiatingWatchdogProvider implements WatchdogProvider {
@Nullable private final ApiClock clock;
@Nullable private final ScheduledExecutorService executor;
- @Nullable private final java.time.Duration checkInterval;
+ private final java.time.@Nullable Duration checkInterval;
public static WatchdogProvider create() {
return new InstantiatingWatchdogProvider(null, null, null);
@@ -58,7 +58,7 @@ public static WatchdogProvider create() {
private InstantiatingWatchdogProvider(
@Nullable ApiClock clock,
@Nullable ScheduledExecutorService executor,
- @Nullable java.time.Duration checkInterval) {
+ java.time.@Nullable Duration checkInterval) {
this.clock = clock;
this.executor = executor;
this.checkInterval = checkInterval;
@@ -70,7 +70,7 @@ public boolean needsClock() {
}
@Override
- public WatchdogProvider withClock(@Nonnull ApiClock clock) {
+ public WatchdogProvider withClock(@NonNull ApiClock clock) {
return new InstantiatingWatchdogProvider(
Preconditions.checkNotNull(clock), executor, checkInterval);
}
@@ -85,12 +85,12 @@ public boolean needsCheckInterval() {
*/
@Override
@ObsoleteApi("Use withCheckIntervalDuration(java.time.Duration) instead")
- public WatchdogProvider withCheckInterval(@Nonnull org.threeten.bp.Duration checkInterval) {
+ public WatchdogProvider withCheckInterval(org.threeten.bp.@NonNull Duration checkInterval) {
return withCheckIntervalDuration(toJavaTimeDuration(checkInterval));
}
@Override
- public WatchdogProvider withCheckIntervalDuration(@Nonnull java.time.Duration checkInterval) {
+ public WatchdogProvider withCheckIntervalDuration(java.time.@NonNull Duration checkInterval) {
return new InstantiatingWatchdogProvider(
clock, executor, Preconditions.checkNotNull(checkInterval));
}
diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/ServerStream.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/ServerStream.java
index d1f9848631..2700a0a1f1 100644
--- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/ServerStream.java
+++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/ServerStream.java
@@ -33,7 +33,7 @@
import java.util.Iterator;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;
-import javax.annotation.Nonnull;
+import org.jspecify.annotations.NonNull;
/**
* A blocking Iterable-style wrapper around server stream responses.
@@ -81,7 +81,7 @@ ResponseObserver retryableCodes;
- @Nonnull private final RetrySettings retrySettings;
- @Nonnull private final StreamResumptionStrategy
retryableCodes;
+ @NonNull private final RetrySettings retrySettings;
+ @NonNull private final StreamResumptionStrategy
getRetryableCodes() {
return retryableCodes;
}
@@ -108,7 +108,7 @@ public Set
getRetryableCodes() {
* See the class documentation of {@link ServerStreamingCallSettings} for a description of what
* retrySettings do.
*/
- @Nonnull
+ @NonNull
public RetrySettings getRetrySettings() {
return retrySettings;
}
@@ -117,15 +117,14 @@ public RetrySettings getRetrySettings() {
* See the class documentation of {@link ServerStreamingCallSettings} and {@link
* StreamResumptionStrategy} for a description of what the StreamResumptionStrategy does.
*/
- @Nonnull
+ @NonNull
public StreamResumptionStrategy
retryableCodes)
return this;
}
- @Nonnull
+ @NonNull
public Set
getRetryableCodes() {
return retryableCodes;
}
@@ -249,13 +245,13 @@ public RetrySettings.Builder retrySettings() {
*
* @see #retrySettings()
*/
- public Builder