diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceClient.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceClient.java index 7dfdbc833e6f..1aa1a4c7c6f4 100644 --- a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceClient.java +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceClient.java @@ -42,6 +42,7 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -360,7 +361,7 @@ @BetaApi @Generated("by gapic-generator-java") public class ComplianceClient implements BackgroundResource { - private final ComplianceSettings settings; + @Nullable private final ComplianceSettings settings; private final ComplianceStub stub; /** Constructs an instance of ComplianceClient with default settings. */ @@ -398,6 +399,7 @@ protected ComplianceClient(ComplianceStub stub) { this.stub = stub; } + @Nullable public final ComplianceSettings getSettings() { return settings; } @@ -1548,8 +1550,8 @@ public static class ListLocationsPage ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { private ListLocationsPage( - PageContext context, - ListLocationsResponse response) { + @Nullable PageContext context, + @Nullable ListLocationsResponse response) { super(context, response); } @@ -1559,14 +1561,14 @@ private static ListLocationsPage createEmptyPage() { @Override protected ListLocationsPage createPage( - PageContext context, - ListLocationsResponse response) { + @Nullable PageContext context, + @Nullable ListLocationsResponse response) { return new ListLocationsPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + @Nullable PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } @@ -1580,7 +1582,8 @@ public static class ListLocationsFixedSizeCollection ListLocationsPage, ListLocationsFixedSizeCollection> { - private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + private ListLocationsFixedSizeCollection( + @Nullable List pages, int collectionSize) { super(pages, collectionSize); } @@ -1590,7 +1593,7 @@ private static ListLocationsFixedSizeCollection createEmptyCollection() { @Override protected ListLocationsFixedSizeCollection createCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { return new ListLocationsFixedSizeCollection(pages, collectionSize); } } diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceSettings.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceSettings.java index 67b1e8395ec5..f91931465a87 100644 --- a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceSettings.java +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceSettings.java @@ -44,6 +44,7 @@ import java.util.List; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -231,7 +232,7 @@ public static Builder newHttpJsonBuilder() { } /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { + public static Builder newBuilder(@Nullable ClientContext clientContext) { return new Builder(clientContext); } @@ -251,7 +252,7 @@ protected Builder() throws IOException { this(((ClientContext) null)); } - protected Builder(ClientContext clientContext) { + protected Builder(@Nullable ClientContext clientContext) { super(ComplianceStubSettings.newBuilder(clientContext)); } diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoClient.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoClient.java index 951b15c1a69c..8c3f3e00e516 100644 --- a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoClient.java +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoClient.java @@ -50,6 +50,7 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -369,7 +370,7 @@ @BetaApi @Generated("by gapic-generator-java") public class EchoClient implements BackgroundResource { - private final EchoSettings settings; + @Nullable private final EchoSettings settings; private final EchoStub stub; private final OperationsClient httpJsonOperationsClient; private final com.google.longrunning.OperationsClient operationsClient; @@ -415,6 +416,7 @@ protected EchoClient(EchoStub stub) { this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); } + @Nullable public final EchoSettings getSettings() { return settings; } @@ -1564,8 +1566,8 @@ public static class PagedExpandPage extends AbstractPage { private PagedExpandPage( - PageContext context, - PagedExpandResponse response) { + @Nullable PageContext context, + @Nullable PagedExpandResponse response) { super(context, response); } @@ -1575,14 +1577,14 @@ private static PagedExpandPage createEmptyPage() { @Override protected PagedExpandPage createPage( - PageContext context, - PagedExpandResponse response) { + @Nullable PageContext context, + @Nullable PagedExpandResponse response) { return new PagedExpandPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + @Nullable PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } @@ -1596,7 +1598,8 @@ public static class PagedExpandFixedSizeCollection PagedExpandPage, PagedExpandFixedSizeCollection> { - private PagedExpandFixedSizeCollection(List pages, int collectionSize) { + private PagedExpandFixedSizeCollection( + @Nullable List pages, int collectionSize) { super(pages, collectionSize); } @@ -1606,7 +1609,7 @@ private static PagedExpandFixedSizeCollection createEmptyCollection() { @Override protected PagedExpandFixedSizeCollection createCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { return new PagedExpandFixedSizeCollection(pages, collectionSize); } } @@ -1647,12 +1650,13 @@ public static class PagedExpandLegacyMappedPage PagedExpandLegacyMappedPage> { private PagedExpandLegacyMappedPage( - PageContext< + @Nullable + PageContext< PagedExpandRequest, PagedExpandLegacyMappedResponse, Map.Entry> context, - PagedExpandLegacyMappedResponse response) { + @Nullable PagedExpandLegacyMappedResponse response) { super(context, response); } @@ -1662,18 +1666,20 @@ private static PagedExpandLegacyMappedPage createEmptyPage() { @Override protected PagedExpandLegacyMappedPage createPage( - PageContext< + @Nullable + PageContext< PagedExpandRequest, PagedExpandLegacyMappedResponse, Map.Entry> context, - PagedExpandLegacyMappedResponse response) { + @Nullable PagedExpandLegacyMappedResponse response) { return new PagedExpandLegacyMappedPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext< + @Nullable + PageContext< PagedExpandRequest, PagedExpandLegacyMappedResponse, Map.Entry> @@ -1692,7 +1698,7 @@ public static class PagedExpandLegacyMappedFixedSizeCollection PagedExpandLegacyMappedFixedSizeCollection> { private PagedExpandLegacyMappedFixedSizeCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { super(pages, collectionSize); } @@ -1702,7 +1708,7 @@ private static PagedExpandLegacyMappedFixedSizeCollection createEmptyCollection( @Override protected PagedExpandLegacyMappedFixedSizeCollection createCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { return new PagedExpandLegacyMappedFixedSizeCollection(pages, collectionSize); } } @@ -1736,8 +1742,8 @@ public static class ListLocationsPage ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { private ListLocationsPage( - PageContext context, - ListLocationsResponse response) { + @Nullable PageContext context, + @Nullable ListLocationsResponse response) { super(context, response); } @@ -1747,14 +1753,14 @@ private static ListLocationsPage createEmptyPage() { @Override protected ListLocationsPage createPage( - PageContext context, - ListLocationsResponse response) { + @Nullable PageContext context, + @Nullable ListLocationsResponse response) { return new ListLocationsPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + @Nullable PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } @@ -1768,7 +1774,8 @@ public static class ListLocationsFixedSizeCollection ListLocationsPage, ListLocationsFixedSizeCollection> { - private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + private ListLocationsFixedSizeCollection( + @Nullable List pages, int collectionSize) { super(pages, collectionSize); } @@ -1778,7 +1785,7 @@ private static ListLocationsFixedSizeCollection createEmptyCollection() { @Override protected ListLocationsFixedSizeCollection createCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { return new ListLocationsFixedSizeCollection(pages, collectionSize); } } diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoSettings.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoSettings.java index 55ce20f85076..4211f5fb1196 100644 --- a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoSettings.java +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoSettings.java @@ -50,6 +50,7 @@ import java.util.List; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -278,7 +279,7 @@ public static Builder newHttpJsonBuilder() { } /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { + public static Builder newBuilder(@Nullable ClientContext clientContext) { return new Builder(clientContext); } @@ -298,7 +299,7 @@ protected Builder() throws IOException { this(((ClientContext) null)); } - protected Builder(ClientContext clientContext) { + protected Builder(@Nullable ClientContext clientContext) { super(EchoStubSettings.newBuilder(clientContext)); } diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/IdentityClient.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/IdentityClient.java index 2a08bf0f7598..b889619cc57d 100644 --- a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/IdentityClient.java +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/IdentityClient.java @@ -43,6 +43,7 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -291,7 +292,7 @@ @BetaApi @Generated("by gapic-generator-java") public class IdentityClient implements BackgroundResource { - private final IdentitySettings settings; + @Nullable private final IdentitySettings settings; private final IdentityStub stub; /** Constructs an instance of IdentityClient with default settings. */ @@ -329,6 +330,7 @@ protected IdentityClient(IdentityStub stub) { this.stub = stub; } + @Nullable public final IdentitySettings getSettings() { return settings; } @@ -501,8 +503,7 @@ public final UnaryCallable createUserCallable() { * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final User getUser(UserName name) { - GetUserRequest request = - GetUserRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + GetUserRequest request = GetUserRequest.newBuilder().setName(name.toString()).build(); return getUser(request); } @@ -662,8 +663,7 @@ public final UnaryCallable updateUserCallable() { * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final void deleteUser(UserName name) { - DeleteUserRequest request = - DeleteUserRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + DeleteUserRequest request = DeleteUserRequest.newBuilder().setName(name.toString()).build(); deleteUser(request); } @@ -1239,8 +1239,8 @@ public static class ListUsersPage extends AbstractPage { private ListUsersPage( - PageContext context, - ListUsersResponse response) { + @Nullable PageContext context, + @Nullable ListUsersResponse response) { super(context, response); } @@ -1250,14 +1250,14 @@ private static ListUsersPage createEmptyPage() { @Override protected ListUsersPage createPage( - PageContext context, - ListUsersResponse response) { + @Nullable PageContext context, + @Nullable ListUsersResponse response) { return new ListUsersPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + @Nullable PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } @@ -1267,7 +1267,7 @@ public static class ListUsersFixedSizeCollection extends AbstractFixedSizeCollection< ListUsersRequest, ListUsersResponse, User, ListUsersPage, ListUsersFixedSizeCollection> { - private ListUsersFixedSizeCollection(List pages, int collectionSize) { + private ListUsersFixedSizeCollection(@Nullable List pages, int collectionSize) { super(pages, collectionSize); } @@ -1277,7 +1277,7 @@ private static ListUsersFixedSizeCollection createEmptyCollection() { @Override protected ListUsersFixedSizeCollection createCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { return new ListUsersFixedSizeCollection(pages, collectionSize); } } @@ -1311,8 +1311,8 @@ public static class ListLocationsPage ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { private ListLocationsPage( - PageContext context, - ListLocationsResponse response) { + @Nullable PageContext context, + @Nullable ListLocationsResponse response) { super(context, response); } @@ -1322,14 +1322,14 @@ private static ListLocationsPage createEmptyPage() { @Override protected ListLocationsPage createPage( - PageContext context, - ListLocationsResponse response) { + @Nullable PageContext context, + @Nullable ListLocationsResponse response) { return new ListLocationsPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + @Nullable PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } @@ -1343,7 +1343,8 @@ public static class ListLocationsFixedSizeCollection ListLocationsPage, ListLocationsFixedSizeCollection> { - private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + private ListLocationsFixedSizeCollection( + @Nullable List pages, int collectionSize) { super(pages, collectionSize); } @@ -1353,7 +1354,7 @@ private static ListLocationsFixedSizeCollection createEmptyCollection() { @Override protected ListLocationsFixedSizeCollection createCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { return new ListLocationsFixedSizeCollection(pages, collectionSize); } } diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/IdentitySettings.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/IdentitySettings.java index 2e530db81883..2084d327c648 100644 --- a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/IdentitySettings.java +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/IdentitySettings.java @@ -46,6 +46,7 @@ import java.util.List; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -209,7 +210,7 @@ public static Builder newHttpJsonBuilder() { } /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { + public static Builder newBuilder(@Nullable ClientContext clientContext) { return new Builder(clientContext); } @@ -229,7 +230,7 @@ protected Builder() throws IOException { this(((ClientContext) null)); } - protected Builder(ClientContext clientContext) { + protected Builder(@Nullable ClientContext clientContext) { super(IdentityStubSettings.newBuilder(clientContext)); } diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingClient.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingClient.java index 4f2f1f868ca1..58f8329700dc 100644 --- a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingClient.java +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingClient.java @@ -51,6 +51,7 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -454,7 +455,7 @@ @BetaApi @Generated("by gapic-generator-java") public class MessagingClient implements BackgroundResource { - private final MessagingSettings settings; + @Nullable private final MessagingSettings settings; private final MessagingStub stub; private final OperationsClient httpJsonOperationsClient; private final com.google.longrunning.OperationsClient operationsClient; @@ -500,6 +501,7 @@ protected MessagingClient(MessagingStub stub) { this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); } + @Nullable public final MessagingSettings getSettings() { return settings; } @@ -630,8 +632,7 @@ public final UnaryCallable createRoomCallable() { * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Room getRoom(RoomName name) { - GetRoomRequest request = - GetRoomRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + GetRoomRequest request = GetRoomRequest.newBuilder().setName(name.toString()).build(); return getRoom(request); } @@ -791,8 +792,7 @@ public final UnaryCallable updateRoomCallable() { * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final void deleteRoom(RoomName name) { - DeleteRoomRequest request = - DeleteRoomRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + DeleteRoomRequest request = DeleteRoomRequest.newBuilder().setName(name.toString()).build(); deleteRoom(request); } @@ -1001,12 +1001,8 @@ public final UnaryCallable listRoomsCallabl public final Blurb createBlurb(ProfileName parent, UserName user, ByteString image) { CreateBlurbRequest request = CreateBlurbRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .setBlurb( - Blurb.newBuilder() - .setUser(user == null ? null : user.toString()) - .setImage(image) - .build()) + .setParent(parent.toString()) + .setBlurb(Blurb.newBuilder().setUser(user.toString()).setImage(image).build()) .build(); return createBlurb(request); } @@ -1041,12 +1037,8 @@ public final Blurb createBlurb(ProfileName parent, UserName user, ByteString ima public final Blurb createBlurb(ProfileName parent, UserName user, String text) { CreateBlurbRequest request = CreateBlurbRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .setBlurb( - Blurb.newBuilder() - .setUser(user == null ? null : user.toString()) - .setText(text) - .build()) + .setParent(parent.toString()) + .setBlurb(Blurb.newBuilder().setUser(user.toString()).setText(text).build()) .build(); return createBlurb(request); } @@ -1081,7 +1073,7 @@ public final Blurb createBlurb(ProfileName parent, UserName user, String text) { public final Blurb createBlurb(ProfileName parent, String user, ByteString image) { CreateBlurbRequest request = CreateBlurbRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) + .setParent(parent.toString()) .setBlurb(Blurb.newBuilder().setUser(user).setImage(image).build()) .build(); return createBlurb(request); @@ -1117,7 +1109,7 @@ public final Blurb createBlurb(ProfileName parent, String user, ByteString image public final Blurb createBlurb(ProfileName parent, String user, String text) { CreateBlurbRequest request = CreateBlurbRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) + .setParent(parent.toString()) .setBlurb(Blurb.newBuilder().setUser(user).setText(text).build()) .build(); return createBlurb(request); @@ -1153,12 +1145,8 @@ public final Blurb createBlurb(ProfileName parent, String user, String text) { public final Blurb createBlurb(RoomName parent, UserName user, ByteString image) { CreateBlurbRequest request = CreateBlurbRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .setBlurb( - Blurb.newBuilder() - .setUser(user == null ? null : user.toString()) - .setImage(image) - .build()) + .setParent(parent.toString()) + .setBlurb(Blurb.newBuilder().setUser(user.toString()).setImage(image).build()) .build(); return createBlurb(request); } @@ -1193,12 +1181,8 @@ public final Blurb createBlurb(RoomName parent, UserName user, ByteString image) public final Blurb createBlurb(RoomName parent, UserName user, String text) { CreateBlurbRequest request = CreateBlurbRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .setBlurb( - Blurb.newBuilder() - .setUser(user == null ? null : user.toString()) - .setText(text) - .build()) + .setParent(parent.toString()) + .setBlurb(Blurb.newBuilder().setUser(user.toString()).setText(text).build()) .build(); return createBlurb(request); } @@ -1233,7 +1217,7 @@ public final Blurb createBlurb(RoomName parent, UserName user, String text) { public final Blurb createBlurb(RoomName parent, String user, ByteString image) { CreateBlurbRequest request = CreateBlurbRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) + .setParent(parent.toString()) .setBlurb(Blurb.newBuilder().setUser(user).setImage(image).build()) .build(); return createBlurb(request); @@ -1269,7 +1253,7 @@ public final Blurb createBlurb(RoomName parent, String user, ByteString image) { public final Blurb createBlurb(RoomName parent, String user, String text) { CreateBlurbRequest request = CreateBlurbRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) + .setParent(parent.toString()) .setBlurb(Blurb.newBuilder().setUser(user).setText(text).build()) .build(); return createBlurb(request); @@ -1306,11 +1290,7 @@ public final Blurb createBlurb(String parent, UserName user, ByteString image) { CreateBlurbRequest request = CreateBlurbRequest.newBuilder() .setParent(parent) - .setBlurb( - Blurb.newBuilder() - .setUser(user == null ? null : user.toString()) - .setImage(image) - .build()) + .setBlurb(Blurb.newBuilder().setUser(user.toString()).setImage(image).build()) .build(); return createBlurb(request); } @@ -1346,11 +1326,7 @@ public final Blurb createBlurb(String parent, UserName user, String text) { CreateBlurbRequest request = CreateBlurbRequest.newBuilder() .setParent(parent) - .setBlurb( - Blurb.newBuilder() - .setUser(user == null ? null : user.toString()) - .setText(text) - .build()) + .setBlurb(Blurb.newBuilder().setUser(user.toString()).setText(text).build()) .build(); return createBlurb(request); } @@ -1508,8 +1484,7 @@ public final UnaryCallable createBlurbCallable() { * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Blurb getBlurb(BlurbName name) { - GetBlurbRequest request = - GetBlurbRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + GetBlurbRequest request = GetBlurbRequest.newBuilder().setName(name.toString()).build(); return getBlurb(request); } @@ -1674,8 +1649,7 @@ public final UnaryCallable updateBlurbCallable() { * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final void deleteBlurb(BlurbName name) { - DeleteBlurbRequest request = - DeleteBlurbRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + DeleteBlurbRequest request = DeleteBlurbRequest.newBuilder().setName(name.toString()).build(); deleteBlurb(request); } @@ -1785,8 +1759,7 @@ public final UnaryCallable deleteBlurbCallable() { * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListBlurbsPagedResponse listBlurbs(ProfileName parent) { - ListBlurbsRequest request = - ListBlurbsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + ListBlurbsRequest request = ListBlurbsRequest.newBuilder().setParent(parent.toString()).build(); return listBlurbs(request); } @@ -1814,8 +1787,7 @@ public final ListBlurbsPagedResponse listBlurbs(ProfileName parent) { * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListBlurbsPagedResponse listBlurbs(RoomName parent) { - ListBlurbsRequest request = - ListBlurbsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + ListBlurbsRequest request = ListBlurbsRequest.newBuilder().setParent(parent.toString()).build(); return listBlurbs(request); } @@ -1976,10 +1948,10 @@ public final UnaryCallable listBlurbsCall * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final OperationFuture searchBlurbsAsync( - ProfileName parent, String query) { + @Nullable ProfileName parent, String query) { SearchBlurbsRequest request = SearchBlurbsRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) + .setParent(parent == null ? "" : parent.toString()) .setQuery(query) .build(); return searchBlurbsAsync(request); @@ -2013,10 +1985,10 @@ public final OperationFuture searchB * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final OperationFuture searchBlurbsAsync( - RoomName parent, String query) { + @Nullable RoomName parent, String query) { SearchBlurbsRequest request = SearchBlurbsRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) + .setParent(parent == null ? "" : parent.toString()) .setQuery(query) .build(); return searchBlurbsAsync(request); @@ -2661,8 +2633,8 @@ public static class ListRoomsPage extends AbstractPage { private ListRoomsPage( - PageContext context, - ListRoomsResponse response) { + @Nullable PageContext context, + @Nullable ListRoomsResponse response) { super(context, response); } @@ -2672,14 +2644,14 @@ private static ListRoomsPage createEmptyPage() { @Override protected ListRoomsPage createPage( - PageContext context, - ListRoomsResponse response) { + @Nullable PageContext context, + @Nullable ListRoomsResponse response) { return new ListRoomsPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + @Nullable PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } @@ -2689,7 +2661,7 @@ public static class ListRoomsFixedSizeCollection extends AbstractFixedSizeCollection< ListRoomsRequest, ListRoomsResponse, Room, ListRoomsPage, ListRoomsFixedSizeCollection> { - private ListRoomsFixedSizeCollection(List pages, int collectionSize) { + private ListRoomsFixedSizeCollection(@Nullable List pages, int collectionSize) { super(pages, collectionSize); } @@ -2699,7 +2671,7 @@ private static ListRoomsFixedSizeCollection createEmptyCollection() { @Override protected ListRoomsFixedSizeCollection createCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { return new ListRoomsFixedSizeCollection(pages, collectionSize); } } @@ -2730,8 +2702,8 @@ public static class ListBlurbsPage extends AbstractPage { private ListBlurbsPage( - PageContext context, - ListBlurbsResponse response) { + @Nullable PageContext context, + @Nullable ListBlurbsResponse response) { super(context, response); } @@ -2741,14 +2713,14 @@ private static ListBlurbsPage createEmptyPage() { @Override protected ListBlurbsPage createPage( - PageContext context, - ListBlurbsResponse response) { + @Nullable PageContext context, + @Nullable ListBlurbsResponse response) { return new ListBlurbsPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + @Nullable PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } @@ -2762,7 +2734,8 @@ public static class ListBlurbsFixedSizeCollection ListBlurbsPage, ListBlurbsFixedSizeCollection> { - private ListBlurbsFixedSizeCollection(List pages, int collectionSize) { + private ListBlurbsFixedSizeCollection( + @Nullable List pages, int collectionSize) { super(pages, collectionSize); } @@ -2772,7 +2745,7 @@ private static ListBlurbsFixedSizeCollection createEmptyCollection() { @Override protected ListBlurbsFixedSizeCollection createCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { return new ListBlurbsFixedSizeCollection(pages, collectionSize); } } @@ -2806,8 +2779,8 @@ public static class ListLocationsPage ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { private ListLocationsPage( - PageContext context, - ListLocationsResponse response) { + @Nullable PageContext context, + @Nullable ListLocationsResponse response) { super(context, response); } @@ -2817,14 +2790,14 @@ private static ListLocationsPage createEmptyPage() { @Override protected ListLocationsPage createPage( - PageContext context, - ListLocationsResponse response) { + @Nullable PageContext context, + @Nullable ListLocationsResponse response) { return new ListLocationsPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + @Nullable PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } @@ -2838,7 +2811,8 @@ public static class ListLocationsFixedSizeCollection ListLocationsPage, ListLocationsFixedSizeCollection> { - private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + private ListLocationsFixedSizeCollection( + @Nullable List pages, int collectionSize) { super(pages, collectionSize); } @@ -2848,7 +2822,7 @@ private static ListLocationsFixedSizeCollection createEmptyCollection() { @Override protected ListLocationsFixedSizeCollection createCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { return new ListLocationsFixedSizeCollection(pages, collectionSize); } } diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingSettings.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingSettings.java index 302303c985ea..13e742a51b78 100644 --- a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingSettings.java +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingSettings.java @@ -51,6 +51,7 @@ import java.util.List; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -292,7 +293,7 @@ public static Builder newHttpJsonBuilder() { } /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { + public static Builder newBuilder(@Nullable ClientContext clientContext) { return new Builder(clientContext); } @@ -312,7 +313,7 @@ protected Builder() throws IOException { this(((ClientContext) null)); } - protected Builder(ClientContext clientContext) { + protected Builder(@Nullable ClientContext clientContext) { super(MessagingStubSettings.newBuilder(clientContext)); } diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/SequenceServiceClient.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/SequenceServiceClient.java index f3e48827b712..76fbcd603ef5 100644 --- a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/SequenceServiceClient.java +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/SequenceServiceClient.java @@ -44,6 +44,7 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -314,7 +315,7 @@ @BetaApi @Generated("by gapic-generator-java") public class SequenceServiceClient implements BackgroundResource { - private final SequenceServiceSettings settings; + @Nullable private final SequenceServiceSettings settings; private final SequenceServiceStub stub; /** Constructs an instance of SequenceServiceClient with default settings. */ @@ -354,6 +355,7 @@ protected SequenceServiceClient(SequenceServiceStub stub) { this.stub = stub; } + @Nullable public final SequenceServiceSettings getSettings() { return settings; } @@ -549,9 +551,7 @@ public final StreamingSequence createStreamingSequence(CreateStreamingSequenceRe */ public final SequenceReport getSequenceReport(SequenceReportName name) { GetSequenceReportRequest request = - GetSequenceReportRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .build(); + GetSequenceReportRequest.newBuilder().setName(name.toString()).build(); return getSequenceReport(request); } @@ -665,9 +665,7 @@ public final UnaryCallable getSequence public final StreamingSequenceReport getStreamingSequenceReport( StreamingSequenceReportName name) { GetStreamingSequenceReportRequest request = - GetStreamingSequenceReportRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .build(); + GetStreamingSequenceReportRequest.newBuilder().setName(name.toString()).build(); return getStreamingSequenceReport(request); } @@ -782,7 +780,7 @@ public final StreamingSequenceReport getStreamingSequenceReport( */ public final void attemptSequence(SequenceName name) { AttemptSequenceRequest request = - AttemptSequenceRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + AttemptSequenceRequest.newBuilder().setName(name.toString()).build(); attemptSequence(request); } @@ -1307,8 +1305,8 @@ public static class ListLocationsPage ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { private ListLocationsPage( - PageContext context, - ListLocationsResponse response) { + @Nullable PageContext context, + @Nullable ListLocationsResponse response) { super(context, response); } @@ -1318,14 +1316,14 @@ private static ListLocationsPage createEmptyPage() { @Override protected ListLocationsPage createPage( - PageContext context, - ListLocationsResponse response) { + @Nullable PageContext context, + @Nullable ListLocationsResponse response) { return new ListLocationsPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + @Nullable PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } @@ -1339,7 +1337,8 @@ public static class ListLocationsFixedSizeCollection ListLocationsPage, ListLocationsFixedSizeCollection> { - private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + private ListLocationsFixedSizeCollection( + @Nullable List pages, int collectionSize) { super(pages, collectionSize); } @@ -1349,7 +1348,7 @@ private static ListLocationsFixedSizeCollection createEmptyCollection() { @Override protected ListLocationsFixedSizeCollection createCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { return new ListLocationsFixedSizeCollection(pages, collectionSize); } } diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/SequenceServiceSettings.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/SequenceServiceSettings.java index 37903aadff11..ea99cb916b90 100644 --- a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/SequenceServiceSettings.java +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/SequenceServiceSettings.java @@ -46,6 +46,7 @@ import java.util.List; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -219,7 +220,7 @@ public static Builder newHttpJsonBuilder() { } /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { + public static Builder newBuilder(@Nullable ClientContext clientContext) { return new Builder(clientContext); } @@ -239,7 +240,7 @@ protected Builder() throws IOException { this(((ClientContext) null)); } - protected Builder(ClientContext clientContext) { + protected Builder(@Nullable ClientContext clientContext) { super(SequenceServiceStubSettings.newBuilder(clientContext)); } diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/TestingClient.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/TestingClient.java index aea75b7a86e3..c612ab23605d 100644 --- a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/TestingClient.java +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/TestingClient.java @@ -43,6 +43,7 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -323,7 +324,7 @@ @BetaApi @Generated("by gapic-generator-java") public class TestingClient implements BackgroundResource { - private final TestingSettings settings; + @Nullable private final TestingSettings settings; private final TestingStub stub; /** Constructs an instance of TestingClient with default settings. */ @@ -361,6 +362,7 @@ protected TestingClient(TestingStub stub) { this.stub = stub; } + @Nullable public final TestingSettings getSettings() { return settings; } @@ -1313,8 +1315,8 @@ public static class ListSessionsPage extends AbstractPage { private ListSessionsPage( - PageContext context, - ListSessionsResponse response) { + @Nullable PageContext context, + @Nullable ListSessionsResponse response) { super(context, response); } @@ -1324,14 +1326,14 @@ private static ListSessionsPage createEmptyPage() { @Override protected ListSessionsPage createPage( - PageContext context, - ListSessionsResponse response) { + @Nullable PageContext context, + @Nullable ListSessionsResponse response) { return new ListSessionsPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + @Nullable PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } @@ -1345,7 +1347,8 @@ public static class ListSessionsFixedSizeCollection ListSessionsPage, ListSessionsFixedSizeCollection> { - private ListSessionsFixedSizeCollection(List pages, int collectionSize) { + private ListSessionsFixedSizeCollection( + @Nullable List pages, int collectionSize) { super(pages, collectionSize); } @@ -1355,7 +1358,7 @@ private static ListSessionsFixedSizeCollection createEmptyCollection() { @Override protected ListSessionsFixedSizeCollection createCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { return new ListSessionsFixedSizeCollection(pages, collectionSize); } } @@ -1382,8 +1385,8 @@ public static class ListTestsPage extends AbstractPage { private ListTestsPage( - PageContext context, - ListTestsResponse response) { + @Nullable PageContext context, + @Nullable ListTestsResponse response) { super(context, response); } @@ -1393,14 +1396,14 @@ private static ListTestsPage createEmptyPage() { @Override protected ListTestsPage createPage( - PageContext context, - ListTestsResponse response) { + @Nullable PageContext context, + @Nullable ListTestsResponse response) { return new ListTestsPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + @Nullable PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } @@ -1410,7 +1413,7 @@ public static class ListTestsFixedSizeCollection extends AbstractFixedSizeCollection< ListTestsRequest, ListTestsResponse, Test, ListTestsPage, ListTestsFixedSizeCollection> { - private ListTestsFixedSizeCollection(List pages, int collectionSize) { + private ListTestsFixedSizeCollection(@Nullable List pages, int collectionSize) { super(pages, collectionSize); } @@ -1420,7 +1423,7 @@ private static ListTestsFixedSizeCollection createEmptyCollection() { @Override protected ListTestsFixedSizeCollection createCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { return new ListTestsFixedSizeCollection(pages, collectionSize); } } @@ -1454,8 +1457,8 @@ public static class ListLocationsPage ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { private ListLocationsPage( - PageContext context, - ListLocationsResponse response) { + @Nullable PageContext context, + @Nullable ListLocationsResponse response) { super(context, response); } @@ -1465,14 +1468,14 @@ private static ListLocationsPage createEmptyPage() { @Override protected ListLocationsPage createPage( - PageContext context, - ListLocationsResponse response) { + @Nullable PageContext context, + @Nullable ListLocationsResponse response) { return new ListLocationsPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + @Nullable PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } @@ -1486,7 +1489,8 @@ public static class ListLocationsFixedSizeCollection ListLocationsPage, ListLocationsFixedSizeCollection> { - private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + private ListLocationsFixedSizeCollection( + @Nullable List pages, int collectionSize) { super(pages, collectionSize); } @@ -1496,7 +1500,7 @@ private static ListLocationsFixedSizeCollection createEmptyCollection() { @Override protected ListLocationsFixedSizeCollection createCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { return new ListLocationsFixedSizeCollection(pages, collectionSize); } } diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/TestingSettings.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/TestingSettings.java index 016da734f965..4bd2aa6ae4a6 100644 --- a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/TestingSettings.java +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/TestingSettings.java @@ -47,6 +47,7 @@ import java.util.List; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -226,7 +227,7 @@ public static Builder newHttpJsonBuilder() { } /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { + public static Builder newBuilder(@Nullable ClientContext clientContext) { return new Builder(clientContext); } @@ -246,7 +247,7 @@ protected Builder() throws IOException { this(((ClientContext) null)); } - protected Builder(ClientContext clientContext) { + protected Builder(@Nullable ClientContext clientContext) { super(TestingStubSettings.newBuilder(clientContext)); } diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStubSettings.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStubSettings.java index a82d26feb9b8..18aea276aace 100644 --- a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStubSettings.java +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStubSettings.java @@ -66,6 +66,7 @@ import java.util.List; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -366,7 +367,7 @@ public static Builder newHttpJsonBuilder() { } /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { + public static Builder newBuilder(@Nullable ClientContext clientContext) { return new Builder(clientContext); } @@ -456,7 +457,7 @@ protected Builder() { this(((ClientContext) null)); } - protected Builder(ClientContext clientContext) { + protected Builder(@Nullable ClientContext clientContext) { super(clientContext); repeatDataBodySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStub.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStub.java index cd41c825e38a..12194648a474 100644 --- a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStub.java +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStub.java @@ -56,6 +56,7 @@ import com.google.showcase.v1beta1.WaitResponse; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -68,11 +69,12 @@ @Generated("by gapic-generator-java") public abstract class EchoStub implements BackgroundResource { - public OperationsStub getOperationsStub() { + public @Nullable OperationsStub getOperationsStub() { return null; } - public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() { + public com.google.api.gax.httpjson.longrunning.stub.@Nullable OperationsStub + getHttpJsonOperationsStub() { return null; } diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStubSettings.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStubSettings.java index c62be894bd9b..95d9974675d5 100644 --- a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStubSettings.java +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStubSettings.java @@ -90,6 +90,7 @@ import java.util.Map; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -554,7 +555,7 @@ public static Builder newHttpJsonBuilder() { } /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { + public static Builder newBuilder(@Nullable ClientContext clientContext) { return new Builder(clientContext); } @@ -674,7 +675,7 @@ protected Builder() { this(((ClientContext) null)); } - protected Builder(ClientContext clientContext) { + protected Builder(@Nullable ClientContext clientContext) { super(clientContext); echoSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/IdentityStubSettings.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/IdentityStubSettings.java index bd1b8ac22d6a..5d61cafc6ff5 100644 --- a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/IdentityStubSettings.java +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/IdentityStubSettings.java @@ -72,6 +72,7 @@ import java.util.List; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -392,7 +393,7 @@ public static Builder newHttpJsonBuilder() { } /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { + public static Builder newBuilder(@Nullable ClientContext clientContext) { return new Builder(clientContext); } @@ -483,7 +484,7 @@ protected Builder() { this(((ClientContext) null)); } - protected Builder(ClientContext clientContext) { + protected Builder(@Nullable ClientContext clientContext) { super(clientContext); createUserSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStub.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStub.java index 370965e9c472..213800424b60 100644 --- a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStub.java +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStub.java @@ -62,6 +62,7 @@ import com.google.showcase.v1beta1.UpdateRoomRequest; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -74,11 +75,12 @@ @Generated("by gapic-generator-java") public abstract class MessagingStub implements BackgroundResource { - public OperationsStub getOperationsStub() { + public @Nullable OperationsStub getOperationsStub() { return null; } - public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() { + public com.google.api.gax.httpjson.longrunning.stub.@Nullable OperationsStub + getHttpJsonOperationsStub() { return null; } diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStubSettings.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStubSettings.java index 63524a233b17..961c64ce4a10 100644 --- a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStubSettings.java +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStubSettings.java @@ -94,6 +94,7 @@ import java.util.List; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -557,7 +558,7 @@ public static Builder newHttpJsonBuilder() { } /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { + public static Builder newBuilder(@Nullable ClientContext clientContext) { return new Builder(clientContext); } @@ -682,7 +683,7 @@ protected Builder() { this(((ClientContext) null)); } - protected Builder(ClientContext clientContext) { + protected Builder(@Nullable ClientContext clientContext) { super(clientContext); createRoomSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/SequenceServiceStubSettings.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/SequenceServiceStubSettings.java index 8e63e65c67b8..f019a95abc35 100644 --- a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/SequenceServiceStubSettings.java +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/SequenceServiceStubSettings.java @@ -76,6 +76,7 @@ import java.util.List; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -361,7 +362,7 @@ public static Builder newHttpJsonBuilder() { } /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { + public static Builder newBuilder(@Nullable ClientContext clientContext) { return new Builder(clientContext); } @@ -466,7 +467,7 @@ protected Builder() { this(((ClientContext) null)); } - protected Builder(ClientContext clientContext) { + protected Builder(@Nullable ClientContext clientContext) { super(clientContext); createSequenceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/TestingStubSettings.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/TestingStubSettings.java index da278f791454..bc09a193d97d 100644 --- a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/TestingStubSettings.java +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/TestingStubSettings.java @@ -79,6 +79,7 @@ import java.util.List; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -472,7 +473,7 @@ public static Builder newHttpJsonBuilder() { } /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { + public static Builder newBuilder(@Nullable ClientContext clientContext) { return new Builder(clientContext); } @@ -557,7 +558,7 @@ protected Builder() { this(((ClientContext) null)); } - protected Builder(ClientContext clientContext) { + protected Builder(@Nullable ClientContext clientContext) { super(clientContext); createSessionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlurbName.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlurbName.java index 2e44117605ba..f81a82356e4a 100644 --- a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlurbName.java +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlurbName.java @@ -27,6 +27,7 @@ import java.util.Objects; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. @NullMarked @@ -188,6 +189,7 @@ public static String formatRoomLegacyRoomBlurbName(String room, String legacyRoo .toString(); } + @Nullable public static BlurbName parse(String formattedString) { if (formattedString.isEmpty()) { return null; @@ -218,7 +220,7 @@ public static List parseList(List formattedStrings) { return list; } - public static List toStringList(List values) { + public static List toStringList(List<@Nullable BlurbName> values) { List list = new ArrayList<>(values.size()); for (BlurbName value : values) { if (value == null) { @@ -275,7 +277,7 @@ public String toString() { } @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (o == this) { return true; } diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ProfileName.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ProfileName.java index ee06ebfc70ff..4853d557ee08 100644 --- a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ProfileName.java +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ProfileName.java @@ -26,6 +26,7 @@ import java.util.Objects; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. @NullMarked @@ -65,6 +66,7 @@ public static String format(String user) { return newBuilder().setUser(user).build().toString(); } + @Nullable public static ProfileName parse(String formattedString) { if (formattedString.isEmpty()) { return null; @@ -83,7 +85,7 @@ public static List parseList(List formattedStrings) { return list; } - public static List toStringList(List values) { + public static List toStringList(List<@Nullable ProfileName> values) { List list = new ArrayList<>(values.size()); for (ProfileName value : values) { if (value == null) { @@ -125,7 +127,7 @@ public String toString() { } @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (o == this) { return true; } diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RoomName.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RoomName.java index 1370b309df9a..c9a65bc2d448 100644 --- a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RoomName.java +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RoomName.java @@ -26,6 +26,7 @@ import java.util.Objects; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. @NullMarked @@ -64,6 +65,7 @@ public static String format(String room) { return newBuilder().setRoom(room).build().toString(); } + @Nullable public static RoomName parse(String formattedString) { if (formattedString.isEmpty()) { return null; @@ -81,7 +83,7 @@ public static List parseList(List formattedStrings) { return list; } - public static List toStringList(List values) { + public static List toStringList(List<@Nullable RoomName> values) { List list = new ArrayList<>(values.size()); for (RoomName value : values) { if (value == null) { @@ -123,7 +125,7 @@ public String toString() { } @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (o == this) { return true; } diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceName.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceName.java index 81b4e7bd25d4..7510ed8fa380 100644 --- a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceName.java +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceName.java @@ -26,6 +26,7 @@ import java.util.Objects; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. @NullMarked @@ -65,6 +66,7 @@ public static String format(String sequence) { return newBuilder().setSequence(sequence).build().toString(); } + @Nullable public static SequenceName parse(String formattedString) { if (formattedString.isEmpty()) { return null; @@ -83,7 +85,7 @@ public static List parseList(List formattedStrings) { return list; } - public static List toStringList(List values) { + public static List toStringList(List<@Nullable SequenceName> values) { List list = new ArrayList<>(values.size()); for (SequenceName value : values) { if (value == null) { @@ -125,7 +127,7 @@ public String toString() { } @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (o == this) { return true; } diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceReportName.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceReportName.java index 16898ca82d83..4477f2ef6002 100644 --- a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceReportName.java +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceReportName.java @@ -26,6 +26,7 @@ import java.util.Objects; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. @NullMarked @@ -65,6 +66,7 @@ public static String format(String sequence) { return newBuilder().setSequence(sequence).build().toString(); } + @Nullable public static SequenceReportName parse(String formattedString) { if (formattedString.isEmpty()) { return null; @@ -83,7 +85,7 @@ public static List parseList(List formattedStrings) return list; } - public static List toStringList(List values) { + public static List toStringList(List<@Nullable SequenceReportName> values) { List list = new ArrayList<>(values.size()); for (SequenceReportName value : values) { if (value == null) { @@ -125,7 +127,7 @@ public String toString() { } @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (o == this) { return true; } diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SessionName.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SessionName.java index 883685a36c55..dbebbded067c 100644 --- a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SessionName.java +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SessionName.java @@ -26,6 +26,7 @@ import java.util.Objects; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. @NullMarked @@ -65,6 +66,7 @@ public static String format(String session) { return newBuilder().setSession(session).build().toString(); } + @Nullable public static SessionName parse(String formattedString) { if (formattedString.isEmpty()) { return null; @@ -83,7 +85,7 @@ public static List parseList(List formattedStrings) { return list; } - public static List toStringList(List values) { + public static List toStringList(List<@Nullable SessionName> values) { List list = new ArrayList<>(values.size()); for (SessionName value : values) { if (value == null) { @@ -125,7 +127,7 @@ public String toString() { } @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (o == this) { return true; } diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceName.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceName.java index e87564212f17..69b59ae2d44b 100644 --- a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceName.java +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceName.java @@ -26,6 +26,7 @@ import java.util.Objects; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. @NullMarked @@ -65,6 +66,7 @@ public static String format(String streamingSequence) { return newBuilder().setStreamingSequence(streamingSequence).build().toString(); } + @Nullable public static StreamingSequenceName parse(String formattedString) { if (formattedString.isEmpty()) { return null; @@ -83,7 +85,7 @@ public static List parseList(List formattedString return list; } - public static List toStringList(List values) { + public static List toStringList(List<@Nullable StreamingSequenceName> values) { List list = new ArrayList<>(values.size()); for (StreamingSequenceName value : values) { if (value == null) { @@ -125,7 +127,7 @@ public String toString() { } @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (o == this) { return true; } diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceReportName.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceReportName.java index ea6ae25d25b0..fd34ed49b8cc 100644 --- a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceReportName.java +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceReportName.java @@ -26,6 +26,7 @@ import java.util.Objects; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. @NullMarked @@ -66,6 +67,7 @@ public static String format(String streamingSequence) { return newBuilder().setStreamingSequence(streamingSequence).build().toString(); } + @Nullable public static StreamingSequenceReportName parse(String formattedString) { if (formattedString.isEmpty()) { return null; @@ -85,7 +87,7 @@ public static List parseList(List formatted return list; } - public static List toStringList(List values) { + public static List toStringList(List<@Nullable StreamingSequenceReportName> values) { List list = new ArrayList<>(values.size()); for (StreamingSequenceReportName value : values) { if (value == null) { @@ -127,7 +129,7 @@ public String toString() { } @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (o == this) { return true; } diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestName.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestName.java index c8b6ed227aff..ff9faaca8be7 100644 --- a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestName.java +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestName.java @@ -26,6 +26,7 @@ import java.util.Objects; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. @NullMarked @@ -72,6 +73,7 @@ public static String format(String session, String test) { return newBuilder().setSession(session).setTest(test).build().toString(); } + @Nullable public static TestName parse(String formattedString) { if (formattedString.isEmpty()) { return null; @@ -90,7 +92,7 @@ public static List parseList(List formattedStrings) { return list; } - public static List toStringList(List values) { + public static List toStringList(List<@Nullable TestName> values) { List list = new ArrayList<>(values.size()); for (TestName value : values) { if (value == null) { @@ -135,7 +137,7 @@ public String toString() { } @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (o == this) { return true; } diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UserName.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UserName.java index 7a9020f92bd9..b0e7894b1203 100644 --- a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UserName.java +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UserName.java @@ -26,6 +26,7 @@ import java.util.Objects; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. @NullMarked @@ -64,6 +65,7 @@ public static String format(String user) { return newBuilder().setUser(user).build().toString(); } + @Nullable public static UserName parse(String formattedString) { if (formattedString.isEmpty()) { return null; @@ -81,7 +83,7 @@ public static List parseList(List formattedStrings) { return list; } - public static List toStringList(List values) { + public static List toStringList(List<@Nullable UserName> values) { List list = new ArrayList<>(values.size()); for (UserName value : values) { if (value == null) { @@ -123,7 +125,7 @@ public String toString() { } @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (o == this) { return true; } diff --git a/sdk-platform-java/bazelisk-amd64.deb b/sdk-platform-java/bazelisk-amd64.deb new file mode 100644 index 000000000000..56c3d0cb0b61 Binary files /dev/null and b/sdk-platform-java/bazelisk-amd64.deb differ diff --git a/sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/engine/ast/ConcreteReference.java b/sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/engine/ast/ConcreteReference.java index 48288ab817a1..9a801d3575a2 100644 --- a/sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/engine/ast/ConcreteReference.java +++ b/sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/engine/ast/ConcreteReference.java @@ -52,6 +52,9 @@ public void accept(AstNodeVisitor visitor) { @Override public abstract boolean isStaticImport(); + @Override + public abstract boolean isNullable(); + @Override public String name() { StringBuilder sb = new StringBuilder(); @@ -199,6 +202,11 @@ public Reference copyAndSetGenerics(List generics) { return toBuilder().setGenerics(generics).build(); } + @Override + public Reference copyAndSetNullable(boolean isNullable) { + return toBuilder().setIsNullable(isNullable).build(); + } + public static ConcreteReference withClazz(Class clazz) { return builder().setClazz(clazz).build(); } @@ -215,7 +223,8 @@ public static Builder builder() { return new AutoValue_ConcreteReference.Builder() .setUseFullName(false) .setGenerics(ImmutableList.of()) - .setIsStaticImport(false); + .setIsStaticImport(false) + .setIsNullable(false); } // Private. @@ -237,6 +246,8 @@ public Builder setGenerics(Reference... references) { public abstract Builder setIsStaticImport(boolean isStaticImport); + public abstract Builder setIsNullable(boolean isNullable); + public abstract ConcreteReference autoBuild(); // Private. diff --git a/sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/engine/ast/Reference.java b/sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/engine/ast/Reference.java index 4dce11783f49..4432c68616aa 100644 --- a/sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/engine/ast/Reference.java +++ b/sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/engine/ast/Reference.java @@ -46,6 +46,8 @@ public interface Reference extends AstNode { Reference copyAndSetGenerics(List generics); + Reference copyAndSetNullable(boolean isNullable); + // Valid only for nested classes. boolean isStaticImport(); @@ -59,4 +61,6 @@ public interface Reference extends AstNode { boolean isAssignableFrom(Reference other); boolean isWildcard(); + + boolean isNullable(); } diff --git a/sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/engine/ast/VaporReference.java b/sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/engine/ast/VaporReference.java index 8c0cc858fa89..8da55dd2bba4 100644 --- a/sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/engine/ast/VaporReference.java +++ b/sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/engine/ast/VaporReference.java @@ -74,6 +74,9 @@ public String fullName() { @Override public abstract boolean isStaticImport(); + @Override + public abstract boolean isNullable(); + @Override public boolean hasEnclosingClass() { return !enclosingClassNames().isEmpty(); @@ -135,12 +138,18 @@ public Reference copyAndSetGenerics(List generics) { return toBuilder().setGenerics(generics).build(); } + @Override + public Reference copyAndSetNullable(boolean isNullable) { + return toBuilder().setIsNullable(isNullable).build(); + } + public static Builder builder() { return new AutoValue_VaporReference.Builder() .setUseFullName(false) .setGenerics(ImmutableList.of()) .setIsStaticImport(false) - .setEnclosingClassNames(Collections.emptyList()); + .setEnclosingClassNames(Collections.emptyList()) + .setIsNullable(false); } // Private. @@ -168,6 +177,8 @@ public Builder setEnclosingClassNames(String... enclosingClassNames) { public abstract Builder setIsStaticImport(boolean isStaticImport); + public abstract Builder setIsNullable(boolean isNullable); + public abstract Builder setSupertypeReference(Reference supertypeReference); // Private. diff --git a/sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/engine/writer/ImportWriterVisitor.java b/sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/engine/writer/ImportWriterVisitor.java index e19e168c3eb5..1d834043c863 100644 --- a/sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/engine/writer/ImportWriterVisitor.java +++ b/sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/engine/writer/ImportWriterVisitor.java @@ -479,6 +479,9 @@ private void variableExpressions(List expressions) { } private void handleReference(Reference reference) { + if (reference.isNullable()) { + addImport("org.jspecify.annotations.Nullable"); + } // Don't need to import this. if (reference.useFullName()) { return; diff --git a/sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/engine/writer/JavaWriterVisitor.java b/sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/engine/writer/JavaWriterVisitor.java index e956d8694992..cc9a11fbb57a 100644 --- a/sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/engine/writer/JavaWriterVisitor.java +++ b/sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/engine/writer/JavaWriterVisitor.java @@ -222,6 +222,10 @@ public void visit(ConcreteReference reference) { buffer.append(DOT); } + if (reference.isNullable()) { + buffer.append("@Nullable "); + } + buffer.append(reference.simpleName()); if (!reference.generics().isEmpty()) { @@ -255,6 +259,10 @@ public void visit(VaporReference reference) { } } + if (reference.isNullable()) { + buffer.append("@Nullable "); + } + // A null pointer exception will be thrown if reference is null, which is WAI. buffer.append(shortName); } diff --git a/sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceClientClassComposer.java b/sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceClientClassComposer.java index 42c7bd743fe4..57707b17009b 100644 --- a/sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceClientClassComposer.java +++ b/sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceClientClassComposer.java @@ -48,6 +48,7 @@ import com.google.api.generator.engine.ast.RelationalOperationExpr; import com.google.api.generator.engine.ast.ScopeNode; import com.google.api.generator.engine.ast.Statement; +import com.google.api.generator.engine.ast.StringObjectValue; import com.google.api.generator.engine.ast.SuperObjectValue; import com.google.api.generator.engine.ast.TernaryExpr; import com.google.api.generator.engine.ast.ThisObjectValue; @@ -104,6 +105,7 @@ import java.util.stream.Collectors; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; public abstract class AbstractServiceClientClassComposer implements ClassComposer { private static final String CALLABLE_NAME_PATTERN = "%sCallable"; @@ -290,14 +292,19 @@ private List createFieldDeclarations( String varName = e.getKey(); TypeNode varType = e.getValue(); Variable variable = Variable.builder().setName(varName).setType(varType).build(); - VariableExpr varExpr = + VariableExpr.Builder varExprBuilder = VariableExpr.builder() .setVariable(variable) .setScope(ScopeNode.PRIVATE) .setIsFinal(true) - .setIsDecl(true) - .build(); - return ExprStatement.withExpr(varExpr); + .setIsDecl(true); + if (varName.equals("settings")) { + varExprBuilder = + varExprBuilder.setAnnotations( + Collections.singletonList( + AnnotationNode.withType(typeStore.get("Nullable")))); + } + return ExprStatement.withExpr(varExprBuilder.build()); }) .collect(Collectors.toList()); } @@ -577,6 +584,12 @@ private List createGetterMethods( ServiceClientCommentComposer.GET_OPERATIONS_CLIENT_METHOD_COMMENT); methodBuilder.setAnnotations(annotations); } + if (methodName.equals("getSettings")) { + methodBuilder = + methodBuilder.setAnnotations( + Collections.singletonList( + AnnotationNode.withType(typeStore.get("Nullable")))); + } return methodBuilder .setScope(ScopeNode.PUBLIC) .setName(methodName) @@ -750,15 +763,22 @@ private static List createMethodVariants( List arguments = signature.stream() .map( - methodArg -> - VariableExpr.builder() - .setVariable( - Variable.builder() - .setName(JavaStyle.toLowerCamelCase(methodArg.name())) - .setType(methodArg.type()) - .build()) - .setIsDecl(true) - .build()) + methodArg -> { + TypeNode argType = methodArg.type(); + if (methodArg.isResourceNameHelper() && !methodArg.field().isRequired()) { + argType = + TypeNode.withReference(argType.reference().copyAndSetNullable(true)); + } + VariableExpr.Builder argBuilder = + VariableExpr.builder() + .setVariable( + Variable.builder() + .setName(JavaStyle.toLowerCamelCase(methodArg.name())) + .setType(argType) + .build()) + .setIsDecl(true); + return argBuilder.build(); + }) .collect(Collectors.toList()); // Request proto builder. @@ -1443,11 +1463,17 @@ private static ClassDefinition createNestedRpcPageClass( .stream() .map(t -> t.reference()) .collect(Collectors.toList())) - .build())) + .build() + .copyAndSetNullable(true))) .build()); VariableExpr responseVarExpr = VariableExpr.withVariable( - Variable.builder().setName("response").setType(method.outputType()).build()); + Variable.builder() + .setName("response") + .setType( + TypeNode.withReference( + method.outputType().reference().copyAndSetNullable(true))) + .build()); MethodDefinition privateCtor = MethodDefinition.constructorBuilder() .setScope(ScopeNode.PRIVATE) @@ -1583,7 +1609,8 @@ private static ClassDefinition createNestedRpcFixedSizeCollectionClass( ConcreteReference.builder() .setClazz(List.class) .setGenerics(Arrays.asList(methodPageType.reference())) - .build())) + .build() + .copyAndSetNullable(true))) .build()); VariableExpr collectionSizeVarExpr = VariableExpr.withVariable( @@ -1734,20 +1761,30 @@ static MethodInvocationExpr buildNestedSetterInvocationExpr( VariableExpr.withVariable( Variable.builder().setName(argumentName).setType(argumentType).build()); if (argument.isResourceNameHelper()) { - Expr nullExpr = ValueExpr.createNullExpr(); - Expr isNullCheckExpr = RelationalOperationExpr.equalToWithExprs(argVarExpr, nullExpr); - MethodInvocationExpr toStringExpr = - MethodInvocationExpr.builder() - .setExprReferenceExpr(argVarExpr) - .setMethodName("toString") - .setReturnType(TypeNode.STRING) - .build(); - argVarExpr = - TernaryExpr.builder() - .setConditionExpr(isNullCheckExpr) - .setThenExpr(nullExpr) - .setElseExpr(toStringExpr) - .build(); + if (argument.field().isRequired()) { + argVarExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(argVarExpr) + .setMethodName("toString") + .setReturnType(TypeNode.STRING) + .build(); + } else { + Expr nullExpr = ValueExpr.createNullExpr(); + Expr isNullCheckExpr = RelationalOperationExpr.equalToWithExprs(argVarExpr, nullExpr); + Expr emptyStringExpr = ValueExpr.withValue(StringObjectValue.withValue("")); + MethodInvocationExpr toStringExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(argVarExpr) + .setMethodName("toString") + .setReturnType(TypeNode.STRING) + .build(); + argVarExpr = + TernaryExpr.builder() + .setConditionExpr(isNullCheckExpr) + .setThenExpr(emptyStringExpr) + .setElseExpr(toStringExpr) + .build(); + } } String setterMethodName = @@ -1789,6 +1826,7 @@ private static TypeStore createTypes(Service service, Map messa IOException.class, MoreExecutors.class, NullMarked.class, + Nullable.class, Objects.class, Operation.class, OperationFuture.class, diff --git a/sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceSettingsClassComposer.java b/sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceSettingsClassComposer.java index d7241886efc8..041e5906100d 100644 --- a/sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceSettingsClassComposer.java +++ b/sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceSettingsClassComposer.java @@ -503,7 +503,9 @@ private static List createBuilderHelperMethods( VariableExpr.withVariable( Variable.builder() .setName("clientContext") - .setType(FIXED_TYPESTORE.get("ClientContext")) + .setType( + TypeNode.withReference( + FIXED_TYPESTORE.get("ClientContext").reference().copyAndSetNullable(true))) .build()); MethodDefinition newBuilderMethodTwo = @@ -618,7 +620,9 @@ private static List createNestedBuilderConstructorMethods( VariableExpr.withVariable( Variable.builder() .setName("clientContext") - .setType(FIXED_TYPESTORE.get("ClientContext")) + .setType( + TypeNode.withReference( + FIXED_TYPESTORE.get("ClientContext").reference().copyAndSetNullable(true))) .build()); MethodDefinition clientContextCtor = ctorMakerFn.apply( diff --git a/sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceStubClassComposer.java b/sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceStubClassComposer.java index 423a25eee11a..b886afac2788 100644 --- a/sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceStubClassComposer.java +++ b/sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceStubClassComposer.java @@ -55,6 +55,7 @@ import java.util.stream.Collectors; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; public abstract class AbstractServiceStubClassComposer implements ClassComposer { @@ -273,6 +274,7 @@ private static TypeStore createTypes(Service service, Map messa ServerStreamingCallable.class, UnaryCallable.class, UnsupportedOperationException.class, + Nullable.class, NullMarked.class); TypeStore typeStore = new TypeStore(concreteClazzes); @@ -313,9 +315,11 @@ protected MethodDefinition createCallableGetterMethodDefinition( protected MethodDefinition createOperationsStubGetterMethodDefinition( TypeNode returnType, String methodName, TypeStore typeStore) { + TypeNode annotatedReturnType = + TypeNode.withReference(returnType.reference().copyAndSetNullable(true)); return MethodDefinition.builder() .setScope(ScopeNode.PUBLIC) - .setReturnType(returnType) + .setReturnType(annotatedReturnType) .setName(methodName) .setBody( Arrays.asList( diff --git a/sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceStubSettingsClassComposer.java b/sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceStubSettingsClassComposer.java index 9a0c1337b115..f8be0f22dfc2 100644 --- a/sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceStubSettingsClassComposer.java +++ b/sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceStubSettingsClassComposer.java @@ -1334,7 +1334,9 @@ protected List createBuilderHelperMethods( VariableExpr clientContextVarExpr = VariableExpr.withVariable( Variable.builder() - .setType(FIXED_TYPESTORE.get("ClientContext")) + .setType( + TypeNode.withReference( + FIXED_TYPESTORE.get("ClientContext").reference().copyAndSetNullable(true))) .setName("clientContext") .build()); javaMethods.add( @@ -1646,7 +1648,9 @@ private static List createNestedClassConstructorMethods( VariableExpr clientContextVarExpr = VariableExpr.withVariable( Variable.builder() - .setType(FIXED_TYPESTORE.get("ClientContext")) + .setType( + TypeNode.withReference( + FIXED_TYPESTORE.get("ClientContext").reference().copyAndSetNullable(true))) .setName("clientContext") .build()); Reference pagedSettingsBuilderRef = diff --git a/sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/grpcrest/ServiceStubClassComposer.java b/sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/grpcrest/ServiceStubClassComposer.java index 6be0ef7ac204..b22629d9e9b7 100644 --- a/sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/grpcrest/ServiceStubClassComposer.java +++ b/sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/grpcrest/ServiceStubClassComposer.java @@ -37,9 +37,11 @@ public static ServiceStubClassComposer instance() { @Override protected MethodDefinition createOperationsStubGetterMethodDefinition( TypeNode returnType, String methodName, TypeStore typeStore) { + TypeNode annotatedReturnType = + TypeNode.withReference(returnType.reference().copyAndSetNullable(true)); return MethodDefinition.builder() .setScope(ScopeNode.PUBLIC) - .setReturnType(returnType) + .setReturnType(annotatedReturnType) .setName(methodName) .setReturnExpr(ReturnExpr.withExpr(ValueExpr.createNullExpr())) .build(); diff --git a/sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/resourcename/ResourceNameHelperClassComposer.java b/sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/resourcename/ResourceNameHelperClassComposer.java index 69f9ca96e0f9..5d2eb5117b76 100644 --- a/sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/resourcename/ResourceNameHelperClassComposer.java +++ b/sdk-platform-java/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/resourcename/ResourceNameHelperClassComposer.java @@ -59,6 +59,7 @@ import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collections; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedHashSet; @@ -70,6 +71,7 @@ import java.util.stream.Collectors; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; public class ResourceNameHelperClassComposer { private static final String CLASS_NAME_PATTERN = "%sName"; @@ -792,6 +794,8 @@ private static MethodDefinition createParseMethod( return MethodDefinition.builder() .setScope(ScopeNode.PUBLIC) .setIsStatic(true) + .setAnnotations( + Collections.singletonList(AnnotationNode.withType(FIXED_TYPESTORE.get("Nullable")))) .setReturnType(thisClassType) .setName("parse") .setArguments(formattedStringArgDeclList) @@ -887,6 +891,8 @@ private static MethodDefinition createParseMethod( return MethodDefinition.builder() .setScope(ScopeNode.PUBLIC) .setIsStatic(true) + .setAnnotations( + Collections.singletonList(AnnotationNode.withType(FIXED_TYPESTORE.get("Nullable")))) .setReturnType(thisClassType) .setName("parse") .setArguments(formattedStringArgDeclList) @@ -970,7 +976,7 @@ private static MethodDefinition createToStringListMethod(TypeNode thisClassType) TypeNode.withReference( ConcreteReference.builder() .setClazz(List.class) - .setGenerics(Arrays.asList(thisClassType.reference())) + .setGenerics(Arrays.asList(thisClassType.reference().copyAndSetNullable(true))) .build()); VariableExpr valuesVarExpr = VariableExpr.withVariable( @@ -1305,7 +1311,7 @@ private static MethodDefinition createEqualsMethod( // Create method definition variables. Variable oVariable = Variable.builder() - .setType(TypeNode.withReference(javaObjectReference)) + .setType(TypeNode.withReference(javaObjectReference.copyAndSetNullable(true))) .setName("o") .build(); VariableExpr argVarExpr = @@ -1702,12 +1708,14 @@ private static TypeStore createStaticTypes() { ImmutableMap.class, List.class, Map.class, + NullMarked.class, + Nullable.class, + Object.class, Objects.class, PathTemplate.class, Preconditions.class, com.google.api.resourcenames.ResourceName.class, - ValidationException.class, - NullMarked.class); + ValidationException.class); return new TypeStore(concreteClazzes); } diff --git a/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/engine/writer/goldens/GrpcServiceClientWithNestedClassImport.golden b/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/engine/writer/goldens/GrpcServiceClientWithNestedClassImport.golden index c5edba8acd9a..47b6909d6a0c 100644 --- a/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/engine/writer/goldens/GrpcServiceClientWithNestedClassImport.golden +++ b/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/engine/writer/goldens/GrpcServiceClientWithNestedClassImport.golden @@ -9,6 +9,7 @@ import java.io.IOException; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -99,7 +100,7 @@ import org.jspecify.annotations.NullMarked; @NullMarked @Generated("by gapic-generator-java") public class NestedMessageServiceClient implements BackgroundResource { - private final NestedMessageServiceSettings settings; + @Nullable private final NestedMessageServiceSettings settings; private final NestedMessageServiceStub stub; /** Constructs an instance of NestedMessageServiceClient with default settings. */ @@ -139,6 +140,7 @@ public class NestedMessageServiceClient implements BackgroundResource { this.stub = stub; } + @Nullable public final NestedMessageServiceSettings getSettings() { return settings; } diff --git a/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/ApiVersionTestingStubSettings.golden b/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/ApiVersionTestingStubSettings.golden index 7b37b4120ddb..c91c3ffee76c 100644 --- a/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/ApiVersionTestingStubSettings.golden +++ b/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/ApiVersionTestingStubSettings.golden @@ -26,6 +26,7 @@ import java.io.IOException; import java.util.List; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -155,7 +156,7 @@ public class EchoWithVersionStubSettings extends StubSettings { private PagedExpandPage( - PageContext context, - PagedExpandResponse response) { + @Nullable PageContext context, + @Nullable PagedExpandResponse response) { super(context, response); } @@ -1264,14 +1264,14 @@ public class EchoClient implements BackgroundResource { @Override protected PagedExpandPage createPage( - PageContext context, - PagedExpandResponse response) { + @Nullable PageContext context, + @Nullable PagedExpandResponse response) { return new PagedExpandPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + @Nullable PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } @@ -1285,7 +1285,8 @@ public class EchoClient implements BackgroundResource { PagedExpandPage, PagedExpandFixedSizeCollection> { - private PagedExpandFixedSizeCollection(List pages, int collectionSize) { + private PagedExpandFixedSizeCollection( + @Nullable List pages, int collectionSize) { super(pages, collectionSize); } @@ -1295,7 +1296,7 @@ public class EchoClient implements BackgroundResource { @Override protected PagedExpandFixedSizeCollection createCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { return new PagedExpandFixedSizeCollection(pages, collectionSize); } } @@ -1329,8 +1330,8 @@ public class EchoClient implements BackgroundResource { PagedExpandRequest, PagedExpandResponse, EchoResponse, SimplePagedExpandPage> { private SimplePagedExpandPage( - PageContext context, - PagedExpandResponse response) { + @Nullable PageContext context, + @Nullable PagedExpandResponse response) { super(context, response); } @@ -1340,14 +1341,14 @@ public class EchoClient implements BackgroundResource { @Override protected SimplePagedExpandPage createPage( - PageContext context, - PagedExpandResponse response) { + @Nullable PageContext context, + @Nullable PagedExpandResponse response) { return new SimplePagedExpandPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + @Nullable PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } @@ -1362,7 +1363,7 @@ public class EchoClient implements BackgroundResource { SimplePagedExpandFixedSizeCollection> { private SimplePagedExpandFixedSizeCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { super(pages, collectionSize); } @@ -1372,7 +1373,7 @@ public class EchoClient implements BackgroundResource { @Override protected SimplePagedExpandFixedSizeCollection createCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { return new SimplePagedExpandFixedSizeCollection(pages, collectionSize); } } diff --git a/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoServiceSelectiveGapicClient.golden b/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoServiceSelectiveGapicClient.golden index 7c2bf556b96d..8f0a2a734616 100644 --- a/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoServiceSelectiveGapicClient.golden +++ b/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoServiceSelectiveGapicClient.golden @@ -11,6 +11,7 @@ import java.io.IOException; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -160,7 +161,7 @@ import org.jspecify.annotations.NullMarked; @BetaApi @Generated("by gapic-generator-java") public class EchoServiceShouldGeneratePartialUsualClient implements BackgroundResource { - private final EchoServiceShouldGeneratePartialUsualSettings settings; + @Nullable private final EchoServiceShouldGeneratePartialUsualSettings settings; private final EchoServiceShouldGeneratePartialUsualStub stub; /** @@ -209,6 +210,7 @@ public class EchoServiceShouldGeneratePartialUsualClient implements BackgroundRe this.stub = stub; } + @Nullable public final EchoServiceShouldGeneratePartialUsualSettings getSettings() { return settings; } @@ -264,8 +266,7 @@ public class EchoServiceShouldGeneratePartialUsualClient implements BackgroundRe * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final EchoResponse echoShouldGenerateAsUsual(FoobarName name) { - EchoRequest request = - EchoRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + EchoRequest request = EchoRequest.newBuilder().setName(name.toString()).build(); return echoShouldGenerateAsUsual(request); } @@ -475,8 +476,7 @@ public class EchoServiceShouldGeneratePartialUsualClient implements BackgroundRe */ @InternalApi("This API is not intended for public consumption.") public final EchoResponse chatShouldGenerateAsInternal(FoobarName name) { - EchoRequest request = - EchoRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + EchoRequest request = EchoRequest.newBuilder().setName(name.toString()).build(); return chatShouldGenerateAsInternal(request); } diff --git a/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoServiceSelectiveGapicServiceSettings.golden b/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoServiceSelectiveGapicServiceSettings.golden index ddb91ae8bcbb..80a7059fe3ca 100644 --- a/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoServiceSelectiveGapicServiceSettings.golden +++ b/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoServiceSelectiveGapicServiceSettings.golden @@ -18,6 +18,7 @@ import java.io.IOException; import java.util.List; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -162,7 +163,7 @@ public class EchoServiceShouldGeneratePartialUsualSettings } /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { + public static Builder newBuilder(@Nullable ClientContext clientContext) { return new Builder(clientContext); } @@ -184,7 +185,7 @@ public class EchoServiceShouldGeneratePartialUsualSettings this(((ClientContext) null)); } - protected Builder(ClientContext clientContext) { + protected Builder(@Nullable ClientContext clientContext) { super(EchoServiceShouldGeneratePartialUsualStubSettings.newBuilder(clientContext)); } diff --git a/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoServiceSelectiveGapicStubSettings.golden b/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoServiceSelectiveGapicStubSettings.golden index 5c171f04360a..da9b2f054327 100644 --- a/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoServiceSelectiveGapicStubSettings.golden +++ b/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoServiceSelectiveGapicStubSettings.golden @@ -29,6 +29,7 @@ import java.io.IOException; import java.util.List; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -201,7 +202,7 @@ public class EchoServiceShouldGeneratePartialUsualStubSettings } /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { + public static Builder newBuilder(@Nullable ClientContext clientContext) { return new Builder(clientContext); } @@ -267,7 +268,7 @@ public class EchoServiceShouldGeneratePartialUsualStubSettings this(((ClientContext) null)); } - protected Builder(ClientContext clientContext) { + protected Builder(@Nullable ClientContext clientContext) { super(clientContext); echoShouldGenerateAsUsualSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); diff --git a/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoSettings.golden b/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoSettings.golden index a9770bf54cd4..4485694ee645 100644 --- a/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoSettings.golden +++ b/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoSettings.golden @@ -24,6 +24,7 @@ import java.io.IOException; import java.util.List; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -210,7 +211,7 @@ public class EchoSettings extends ClientSettings { } /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { + public static Builder newBuilder(@Nullable ClientContext clientContext) { return new Builder(clientContext); } @@ -230,7 +231,7 @@ public class EchoSettings extends ClientSettings { this(((ClientContext) null)); } - protected Builder(ClientContext clientContext) { + protected Builder(@Nullable ClientContext clientContext) { super(EchoStubSettings.newBuilder(clientContext)); } diff --git a/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoStub.golden b/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoStub.golden index 8fed4fe54d48..722a5ff7d478 100644 --- a/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoStub.golden +++ b/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoStub.golden @@ -26,6 +26,7 @@ import com.google.showcase.v1beta1.WaitRequest; import com.google.showcase.v1beta1.WaitResponse; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -38,7 +39,7 @@ import org.jspecify.annotations.NullMarked; @Generated("by gapic-generator-java") public abstract class EchoStub implements BackgroundResource { - public OperationsStub getOperationsStub() { + public @Nullable OperationsStub getOperationsStub() { throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); } diff --git a/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoStubSettings.golden b/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoStubSettings.golden index 6713de000399..33f3c72989b6 100644 --- a/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoStubSettings.golden +++ b/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoStubSettings.golden @@ -55,6 +55,7 @@ import java.time.Duration; import java.util.List; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -384,7 +385,7 @@ public class EchoStubSettings extends StubSettings { } /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { + public static Builder newBuilder(@Nullable ClientContext clientContext) { return new Builder(clientContext); } @@ -486,7 +487,7 @@ public class EchoStubSettings extends StubSettings { this(((ClientContext) null)); } - protected Builder(ClientContext clientContext) { + protected Builder(@Nullable ClientContext clientContext) { super(clientContext); echoSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); diff --git a/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/IdentityClient.golden b/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/IdentityClient.golden index 1f6390842460..c4ebbe14dca6 100644 --- a/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/IdentityClient.golden +++ b/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/IdentityClient.golden @@ -18,6 +18,7 @@ import java.util.List; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -180,7 +181,7 @@ import org.jspecify.annotations.NullMarked; @BetaApi @Generated("by gapic-generator-java") public class IdentityClient implements BackgroundResource { - private final IdentitySettings settings; + @Nullable private final IdentitySettings settings; private final IdentityStub stub; /** Constructs an instance of IdentityClient with default settings. */ @@ -218,6 +219,7 @@ public class IdentityClient implements BackgroundResource { this.stub = stub; } + @Nullable public final IdentitySettings getSettings() { return settings; } @@ -478,8 +480,7 @@ public class IdentityClient implements BackgroundResource { * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final User getUser(UserName name) { - GetUserRequest request = - GetUserRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + GetUserRequest request = GetUserRequest.newBuilder().setName(name.toString()).build(); return getUser(request); } @@ -621,8 +622,7 @@ public class IdentityClient implements BackgroundResource { * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final void deleteUser(UserName name) { - DeleteUserRequest request = - DeleteUserRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + DeleteUserRequest request = DeleteUserRequest.newBuilder().setName(name.toString()).build(); deleteUser(request); } @@ -841,8 +841,8 @@ public class IdentityClient implements BackgroundResource { extends AbstractPage { private ListUsersPage( - PageContext context, - ListUsersResponse response) { + @Nullable PageContext context, + @Nullable ListUsersResponse response) { super(context, response); } @@ -852,14 +852,14 @@ public class IdentityClient implements BackgroundResource { @Override protected ListUsersPage createPage( - PageContext context, - ListUsersResponse response) { + @Nullable PageContext context, + @Nullable ListUsersResponse response) { return new ListUsersPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + @Nullable PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } @@ -869,7 +869,7 @@ public class IdentityClient implements BackgroundResource { extends AbstractFixedSizeCollection< ListUsersRequest, ListUsersResponse, User, ListUsersPage, ListUsersFixedSizeCollection> { - private ListUsersFixedSizeCollection(List pages, int collectionSize) { + private ListUsersFixedSizeCollection(@Nullable List pages, int collectionSize) { super(pages, collectionSize); } @@ -879,7 +879,7 @@ public class IdentityClient implements BackgroundResource { @Override protected ListUsersFixedSizeCollection createCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { return new ListUsersFixedSizeCollection(pages, collectionSize); } } diff --git a/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/JobServiceStubSettings.golden b/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/JobServiceStubSettings.golden index 6ec8f16f177c..51ac4722bdb3 100644 --- a/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/JobServiceStubSettings.golden +++ b/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/JobServiceStubSettings.golden @@ -37,6 +37,7 @@ import java.time.Duration; import java.util.List; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -244,7 +245,7 @@ public class JobServiceStubSettings extends StubSettings } /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { + public static Builder newBuilder(@Nullable ClientContext clientContext) { return new Builder(clientContext); } @@ -303,7 +304,7 @@ public class JobServiceStubSettings extends StubSettings this(((ClientContext) null)); } - protected Builder(ClientContext clientContext) { + protected Builder(@Nullable ClientContext clientContext) { super(clientContext); deleteJobSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); diff --git a/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/LoggingServiceV2StubSettings.golden b/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/LoggingServiceV2StubSettings.golden index 213edf6a3d4b..e444d22a0806 100644 --- a/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/LoggingServiceV2StubSettings.golden +++ b/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/LoggingServiceV2StubSettings.golden @@ -60,6 +60,7 @@ import java.util.Collection; import java.util.List; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -491,7 +492,7 @@ public class LoggingServiceV2StubSettings extends StubSettings { private ListRoomsPage( - PageContext context, - ListRoomsResponse response) { + @Nullable PageContext context, + @Nullable ListRoomsResponse response) { super(context, response); } @@ -1723,14 +1719,14 @@ public class MessagingClient implements BackgroundResource { @Override protected ListRoomsPage createPage( - PageContext context, - ListRoomsResponse response) { + @Nullable PageContext context, + @Nullable ListRoomsResponse response) { return new ListRoomsPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + @Nullable PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } @@ -1740,7 +1736,7 @@ public class MessagingClient implements BackgroundResource { extends AbstractFixedSizeCollection< ListRoomsRequest, ListRoomsResponse, Room, ListRoomsPage, ListRoomsFixedSizeCollection> { - private ListRoomsFixedSizeCollection(List pages, int collectionSize) { + private ListRoomsFixedSizeCollection(@Nullable List pages, int collectionSize) { super(pages, collectionSize); } @@ -1750,7 +1746,7 @@ public class MessagingClient implements BackgroundResource { @Override protected ListRoomsFixedSizeCollection createCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { return new ListRoomsFixedSizeCollection(pages, collectionSize); } } @@ -1781,8 +1777,8 @@ public class MessagingClient implements BackgroundResource { extends AbstractPage { private ListBlurbsPage( - PageContext context, - ListBlurbsResponse response) { + @Nullable PageContext context, + @Nullable ListBlurbsResponse response) { super(context, response); } @@ -1792,14 +1788,14 @@ public class MessagingClient implements BackgroundResource { @Override protected ListBlurbsPage createPage( - PageContext context, - ListBlurbsResponse response) { + @Nullable PageContext context, + @Nullable ListBlurbsResponse response) { return new ListBlurbsPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + @Nullable PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } @@ -1813,7 +1809,8 @@ public class MessagingClient implements BackgroundResource { ListBlurbsPage, ListBlurbsFixedSizeCollection> { - private ListBlurbsFixedSizeCollection(List pages, int collectionSize) { + private ListBlurbsFixedSizeCollection( + @Nullable List pages, int collectionSize) { super(pages, collectionSize); } @@ -1823,7 +1820,7 @@ public class MessagingClient implements BackgroundResource { @Override protected ListBlurbsFixedSizeCollection createCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { return new ListBlurbsFixedSizeCollection(pages, collectionSize); } } diff --git a/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/PublisherStubSettings.golden b/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/PublisherStubSettings.golden index 5dd715e05b8f..ccd40a8ff758 100644 --- a/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/PublisherStubSettings.golden +++ b/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/PublisherStubSettings.golden @@ -61,6 +61,7 @@ import java.util.Collection; import java.util.List; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -499,7 +500,7 @@ public class PublisherStubSettings extends StubSettings { } /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { + public static Builder newBuilder(@Nullable ClientContext clientContext) { return new Builder(clientContext); } @@ -621,7 +622,7 @@ public class PublisherStubSettings extends StubSettings { this(((ClientContext) null)); } - protected Builder(ClientContext clientContext) { + protected Builder(@Nullable ClientContext clientContext) { super(clientContext); createTopicSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); diff --git a/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoClient.golden b/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoClient.golden index 35c02eda2d66..925be3baf253 100644 --- a/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoClient.golden +++ b/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoClient.golden @@ -28,6 +28,7 @@ import java.util.List; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -287,7 +288,7 @@ import org.jspecify.annotations.NullMarked; @BetaApi @Generated("by gapic-generator-java") public class EchoClient implements BackgroundResource { - private final EchoSettings settings; + @Nullable private final EchoSettings settings; private final EchoStub stub; private final OperationsClient httpJsonOperationsClient; private final com.google.longrunning.OperationsClient operationsClient; @@ -333,6 +334,7 @@ public class EchoClient implements BackgroundResource { this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); } + @Nullable public final EchoSettings getSettings() { return settings; } @@ -401,8 +403,7 @@ public class EchoClient implements BackgroundResource { * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final EchoResponse echo(ResourceName parent) { - EchoRequest request = - EchoRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + EchoRequest request = EchoRequest.newBuilder().setParent(parent.toString()).build(); return echo(request); } @@ -450,8 +451,7 @@ public class EchoClient implements BackgroundResource { * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final EchoResponse echo(FoobarName name) { - EchoRequest request = - EchoRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + EchoRequest request = EchoRequest.newBuilder().setName(name.toString()).build(); return echo(request); } @@ -1348,8 +1348,8 @@ public class EchoClient implements BackgroundResource { extends AbstractPage { private PagedExpandPage( - PageContext context, - PagedExpandResponse response) { + @Nullable PageContext context, + @Nullable PagedExpandResponse response) { super(context, response); } @@ -1359,14 +1359,14 @@ public class EchoClient implements BackgroundResource { @Override protected PagedExpandPage createPage( - PageContext context, - PagedExpandResponse response) { + @Nullable PageContext context, + @Nullable PagedExpandResponse response) { return new PagedExpandPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + @Nullable PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } @@ -1380,7 +1380,8 @@ public class EchoClient implements BackgroundResource { PagedExpandPage, PagedExpandFixedSizeCollection> { - private PagedExpandFixedSizeCollection(List pages, int collectionSize) { + private PagedExpandFixedSizeCollection( + @Nullable List pages, int collectionSize) { super(pages, collectionSize); } @@ -1390,7 +1391,7 @@ public class EchoClient implements BackgroundResource { @Override protected PagedExpandFixedSizeCollection createCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { return new PagedExpandFixedSizeCollection(pages, collectionSize); } } @@ -1424,8 +1425,8 @@ public class EchoClient implements BackgroundResource { PagedExpandRequest, PagedExpandResponse, EchoResponse, SimplePagedExpandPage> { private SimplePagedExpandPage( - PageContext context, - PagedExpandResponse response) { + @Nullable PageContext context, + @Nullable PagedExpandResponse response) { super(context, response); } @@ -1435,14 +1436,14 @@ public class EchoClient implements BackgroundResource { @Override protected SimplePagedExpandPage createPage( - PageContext context, - PagedExpandResponse response) { + @Nullable PageContext context, + @Nullable PagedExpandResponse response) { return new SimplePagedExpandPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + @Nullable PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } @@ -1457,7 +1458,7 @@ public class EchoClient implements BackgroundResource { SimplePagedExpandFixedSizeCollection> { private SimplePagedExpandFixedSizeCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { super(pages, collectionSize); } @@ -1467,7 +1468,7 @@ public class EchoClient implements BackgroundResource { @Override protected SimplePagedExpandFixedSizeCollection createCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { return new SimplePagedExpandFixedSizeCollection(pages, collectionSize); } } diff --git a/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoSettings.golden b/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoSettings.golden index 12383ffd66c1..e958ab4b213a 100644 --- a/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoSettings.golden +++ b/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoSettings.golden @@ -25,6 +25,7 @@ import java.io.IOException; import java.util.List; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -222,7 +223,7 @@ public class EchoSettings extends ClientSettings { } /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { + public static Builder newBuilder(@Nullable ClientContext clientContext) { return new Builder(clientContext); } @@ -242,7 +243,7 @@ public class EchoSettings extends ClientSettings { this(((ClientContext) null)); } - protected Builder(ClientContext clientContext) { + protected Builder(@Nullable ClientContext clientContext) { super(EchoStubSettings.newBuilder(clientContext)); } diff --git a/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoStubSettings.golden b/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoStubSettings.golden index e29f91480185..fec96bbd33d6 100644 --- a/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoStubSettings.golden +++ b/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoStubSettings.golden @@ -59,6 +59,7 @@ import java.time.Duration; import java.util.List; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -416,7 +417,7 @@ public class EchoStubSettings extends StubSettings { } /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { + public static Builder newBuilder(@Nullable ClientContext clientContext) { return new Builder(clientContext); } @@ -495,7 +496,7 @@ public class EchoStubSettings extends StubSettings { this(((ClientContext) null)); } - protected Builder(ClientContext clientContext) { + protected Builder(@Nullable ClientContext clientContext) { super(clientContext); echoSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); diff --git a/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/WickedClient.golden b/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/WickedClient.golden index fff1e0377a22..dc7a3584e0eb 100644 --- a/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/WickedClient.golden +++ b/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/WickedClient.golden @@ -11,6 +11,7 @@ import java.io.IOException; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -118,7 +119,7 @@ import org.jspecify.annotations.NullMarked; @BetaApi @Generated("by gapic-generator-java") public class WickedClient implements BackgroundResource { - private final WickedSettings settings; + @Nullable private final WickedSettings settings; private final WickedStub stub; /** Constructs an instance of WickedClient with default settings. */ @@ -156,6 +157,7 @@ public class WickedClient implements BackgroundResource { this.stub = stub; } + @Nullable public final WickedSettings getSettings() { return settings; } diff --git a/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/WickedSettings.golden b/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/WickedSettings.golden index 95f2e533d03d..379a54ec5695 100644 --- a/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/WickedSettings.golden +++ b/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/WickedSettings.golden @@ -17,6 +17,7 @@ import java.io.IOException; import java.util.List; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -130,7 +131,7 @@ public class WickedSettings extends ClientSettings { } /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { + public static Builder newBuilder(@Nullable ClientContext clientContext) { return new Builder(clientContext); } @@ -150,7 +151,7 @@ public class WickedSettings extends ClientSettings { this(((ClientContext) null)); } - protected Builder(ClientContext clientContext) { + protected Builder(@Nullable ClientContext clientContext) { super(WickedStubSettings.newBuilder(clientContext)); } diff --git a/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/WickedStubSettings.golden b/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/WickedStubSettings.golden index 4a1bc0d0ea14..18b8492d36f2 100644 --- a/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/WickedStubSettings.golden +++ b/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/WickedStubSettings.golden @@ -28,6 +28,7 @@ import java.io.IOException; import java.util.List; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -172,7 +173,7 @@ public class WickedStubSettings extends StubSettings { } /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { + public static Builder newBuilder(@Nullable ClientContext clientContext) { return new Builder(clientContext); } @@ -228,7 +229,7 @@ public class WickedStubSettings extends StubSettings { this(((ClientContext) null)); } - protected Builder(ClientContext clientContext) { + protected Builder(@Nullable ClientContext clientContext) { super(clientContext); craftEvilPlanSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); diff --git a/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/goldens/AgentName.golden b/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/goldens/AgentName.golden index a35217c08a0a..0a6da96c45e6 100644 --- a/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/goldens/AgentName.golden +++ b/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/goldens/AgentName.golden @@ -11,6 +11,7 @@ import java.util.Map; import java.util.Objects; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. @NullMarked @@ -92,6 +93,7 @@ public class AgentName implements ResourceName { return newProjectBuilder().setProject(project).build().toString(); } + @Nullable public static AgentName parse(String formattedString) { if (formattedString.isEmpty()) { return null; @@ -114,7 +116,7 @@ public class AgentName implements ResourceName { return list; } - public static List toStringList(List values) { + public static List toStringList(List<@Nullable AgentName> values) { List list = new ArrayList<>(values.size()); for (AgentName value : values) { if (value == null) { @@ -159,7 +161,7 @@ public class AgentName implements ResourceName { } @Override - public boolean equals(java.lang.Object o) { + public boolean equals(java.lang.@Nullable Object o) { if (o == this) { return true; } diff --git a/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/goldens/BillingAccountLocationName.golden b/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/goldens/BillingAccountLocationName.golden index bf9b58f73ed0..230c59eee271 100644 --- a/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/goldens/BillingAccountLocationName.golden +++ b/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/goldens/BillingAccountLocationName.golden @@ -10,6 +10,7 @@ import java.util.Map; import java.util.Objects; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. @NullMarked @@ -57,6 +58,7 @@ public class BillingAccountLocationName implements ResourceName { return newBuilder().setBillingAccount(billingAccount).setLocation(location).build().toString(); } + @Nullable public static BillingAccountLocationName parse(String formattedString) { if (formattedString.isEmpty()) { return null; @@ -76,7 +78,7 @@ public class BillingAccountLocationName implements ResourceName { return list; } - public static List toStringList(List values) { + public static List toStringList(List<@Nullable BillingAccountLocationName> values) { List list = new ArrayList<>(values.size()); for (BillingAccountLocationName value : values) { if (value == null) { @@ -122,7 +124,7 @@ public class BillingAccountLocationName implements ResourceName { } @Override - public boolean equals(java.lang.Object o) { + public boolean equals(java.lang.@Nullable Object o) { if (o == this) { return true; } diff --git a/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/goldens/CollisionResourceName.golden b/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/goldens/CollisionResourceName.golden index 515dc35aead2..3e12ba3d82a5 100644 --- a/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/goldens/CollisionResourceName.golden +++ b/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/goldens/CollisionResourceName.golden @@ -9,6 +9,7 @@ import java.util.Map; import java.util.Objects; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. @NullMarked @@ -92,6 +93,7 @@ public class ResourceName implements com.google.api.resourcenames.ResourceName { .toString(); } + @Nullable public static ResourceName parse(String formattedString) { if (formattedString.isEmpty()) { return null; @@ -115,7 +117,7 @@ public class ResourceName implements com.google.api.resourcenames.ResourceName { return list; } - public static List toStringList(List values) { + public static List toStringList(List<@Nullable ResourceName> values) { List list = new ArrayList<>(values.size()); for (ResourceName value : values) { if (value == null) { @@ -179,7 +181,7 @@ public class ResourceName implements com.google.api.resourcenames.ResourceName { } @Override - public boolean equals(java.lang.Object o) { + public boolean equals(java.lang.@Nullable Object o) { if (o == this) { return true; } diff --git a/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/goldens/FoobarName.golden b/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/goldens/FoobarName.golden index c9e2d43c6959..ce76ea616704 100644 --- a/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/goldens/FoobarName.golden +++ b/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/goldens/FoobarName.golden @@ -11,6 +11,7 @@ import java.util.Map; import java.util.Objects; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. @NullMarked @@ -164,6 +165,7 @@ public class FoobarName implements ResourceName { return newBarFooFoobarBuilder().setBarFoo(barFoo).setFoobar(foobar).build().toString(); } + @Nullable public static FoobarName parse(String formattedString) { if (formattedString.isEmpty()) { return null; @@ -193,7 +195,7 @@ public class FoobarName implements ResourceName { return list; } - public static List toStringList(List values) { + public static List toStringList(List<@Nullable FoobarName> values) { List list = new ArrayList<>(values.size()); for (FoobarName value : values) { if (value == null) { @@ -247,7 +249,7 @@ public class FoobarName implements ResourceName { } @Override - public boolean equals(java.lang.Object o) { + public boolean equals(java.lang.@Nullable Object o) { if (o == this) { return true; } diff --git a/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/goldens/SessionName.golden b/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/goldens/SessionName.golden index f5c711d82aa2..983988cf201c 100644 --- a/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/goldens/SessionName.golden +++ b/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/goldens/SessionName.golden @@ -10,6 +10,7 @@ import java.util.Map; import java.util.Objects; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. @NullMarked @@ -49,6 +50,7 @@ public class SessionName implements ResourceName { return newBuilder().setSession(session).build().toString(); } + @Nullable public static SessionName parse(String formattedString) { if (formattedString.isEmpty()) { return null; @@ -67,7 +69,7 @@ public class SessionName implements ResourceName { return list; } - public static List toStringList(List values) { + public static List toStringList(List<@Nullable SessionName> values) { List list = new ArrayList<>(values.size()); for (SessionName value : values) { if (value == null) { @@ -109,7 +111,7 @@ public class SessionName implements ResourceName { } @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (o == this) { return true; } diff --git a/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/goldens/TestName.golden b/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/goldens/TestName.golden index 571aec00ec5f..8a6039f6b0c4 100644 --- a/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/goldens/TestName.golden +++ b/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/goldens/TestName.golden @@ -10,6 +10,7 @@ import java.util.Map; import java.util.Objects; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. @NullMarked @@ -68,6 +69,7 @@ public class TestName implements ResourceName { .toString(); } + @Nullable public static TestName parse(String formattedString) { if (formattedString.isEmpty()) { return null; @@ -86,7 +88,7 @@ public class TestName implements ResourceName { return list; } - public static List toStringList(List values) { + public static List toStringList(List<@Nullable TestName> values) { List list = new ArrayList<>(values.size()); for (TestName value : values) { if (value == null) { @@ -135,7 +137,7 @@ public class TestName implements ResourceName { } @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (o == this) { return true; } diff --git a/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/ComplianceSettings.golden b/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/ComplianceSettings.golden index 1d554dc788b6..398269dbe082 100644 --- a/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/ComplianceSettings.golden +++ b/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/ComplianceSettings.golden @@ -16,6 +16,7 @@ import java.io.IOException; import java.util.List; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -171,7 +172,7 @@ public class ComplianceSettings extends ClientSettings { } /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { + public static Builder newBuilder(@Nullable ClientContext clientContext) { return new Builder(clientContext); } @@ -191,7 +192,7 @@ public class ComplianceSettings extends ClientSettings { this(((ClientContext) null)); } - protected Builder(ClientContext clientContext) { + protected Builder(@Nullable ClientContext clientContext) { super(ComplianceStubSettings.newBuilder(clientContext)); } diff --git a/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/ComplianceStubSettings.golden b/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/ComplianceStubSettings.golden index db257e4d5a3d..2109fb496882 100644 --- a/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/ComplianceStubSettings.golden +++ b/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/ComplianceStubSettings.golden @@ -30,6 +30,7 @@ import java.io.IOException; import java.util.List; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -225,7 +226,7 @@ public class ComplianceStubSettings extends StubSettings } /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { + public static Builder newBuilder(@Nullable ClientContext clientContext) { return new Builder(clientContext); } @@ -302,7 +303,7 @@ public class ComplianceStubSettings extends StubSettings this(((ClientContext) null)); } - protected Builder(ClientContext clientContext) { + protected Builder(@Nullable ClientContext clientContext) { super(clientContext); repeatDataBodySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); diff --git a/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/HttpJsonApiVersionTestingStubSettings.golden b/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/HttpJsonApiVersionTestingStubSettings.golden index 8b0b94e4daab..cae16ce62420 100644 --- a/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/HttpJsonApiVersionTestingStubSettings.golden +++ b/sdk-platform-java/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/HttpJsonApiVersionTestingStubSettings.golden @@ -26,6 +26,7 @@ import java.io.IOException; import java.util.List; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -157,7 +158,7 @@ public class EchoWithVersionStubSettings extends StubSettings { private ListConnectionsPage( - PageContext context, - ListConnectionsResponse response) { + @Nullable PageContext context, + @Nullable ListConnectionsResponse response) { super(context, response); } @@ -430,14 +430,14 @@ private static ListConnectionsPage createEmptyPage() { @Override protected ListConnectionsPage createPage( - PageContext context, - ListConnectionsResponse response) { + @Nullable PageContext context, + @Nullable ListConnectionsResponse response) { return new ListConnectionsPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + @Nullable PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } @@ -452,7 +452,7 @@ public static class ListConnectionsFixedSizeCollection ListConnectionsFixedSizeCollection> { private ListConnectionsFixedSizeCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { super(pages, collectionSize); } @@ -462,7 +462,7 @@ private static ListConnectionsFixedSizeCollection createEmptyCollection() { @Override protected ListConnectionsFixedSizeCollection createCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { return new ListConnectionsFixedSizeCollection(pages, collectionSize); } } diff --git a/sdk-platform-java/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/ConnectionServiceSettings.java b/sdk-platform-java/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/ConnectionServiceSettings.java index f2095fd712b0..eb52dbe4a78f 100644 --- a/sdk-platform-java/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/ConnectionServiceSettings.java +++ b/sdk-platform-java/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/ConnectionServiceSettings.java @@ -36,6 +36,7 @@ import java.util.List; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -154,7 +155,7 @@ public static Builder newHttpJsonBuilder() { } /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { + public static Builder newBuilder(@Nullable ClientContext clientContext) { return new Builder(clientContext); } @@ -174,7 +175,7 @@ protected Builder() throws IOException { this(((ClientContext) null)); } - protected Builder(ClientContext clientContext) { + protected Builder(@Nullable ClientContext clientContext) { super(ConnectionServiceStubSettings.newBuilder(clientContext)); } diff --git a/sdk-platform-java/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/EndpointName.java b/sdk-platform-java/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/EndpointName.java index 9c8e5208230c..0d6db85437e2 100644 --- a/sdk-platform-java/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/EndpointName.java +++ b/sdk-platform-java/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/EndpointName.java @@ -26,6 +26,7 @@ import java.util.Objects; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. @NullMarked @@ -72,6 +73,7 @@ public static String format(String project, String endpoint) { return newBuilder().setProject(project).setEndpoint(endpoint).build().toString(); } + @Nullable public static EndpointName parse(String formattedString) { if (formattedString.isEmpty()) { return null; @@ -90,7 +92,7 @@ public static List parseList(List formattedStrings) { return list; } - public static List toStringList(List values) { + public static List toStringList(List<@Nullable EndpointName> values) { List list = new ArrayList<>(values.size()); for (EndpointName value : values) { if (value == null) { @@ -135,7 +137,7 @@ public String toString() { } @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (o == this) { return true; } diff --git a/sdk-platform-java/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/TetherClient.java b/sdk-platform-java/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/TetherClient.java index bd296833e614..2772ff99b6ea 100644 --- a/sdk-platform-java/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/TetherClient.java +++ b/sdk-platform-java/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/TetherClient.java @@ -24,6 +24,7 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -122,7 +123,7 @@ @NullMarked @Generated("by gapic-generator-java") public class TetherClient implements BackgroundResource { - private final TetherSettings settings; + @Nullable private final TetherSettings settings; private final TetherStub stub; /** Constructs an instance of TetherClient with default settings. */ @@ -160,6 +161,7 @@ protected TetherClient(TetherStub stub) { this.stub = stub; } + @Nullable public final TetherSettings getSettings() { return settings; } diff --git a/sdk-platform-java/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/TetherSettings.java b/sdk-platform-java/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/TetherSettings.java index fbbdbe0359ef..f187fab685b0 100644 --- a/sdk-platform-java/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/TetherSettings.java +++ b/sdk-platform-java/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/TetherSettings.java @@ -32,6 +32,7 @@ import java.util.List; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -134,7 +135,7 @@ public static Builder newBuilder() { } /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { + public static Builder newBuilder(@Nullable ClientContext clientContext) { return new Builder(clientContext); } @@ -154,7 +155,7 @@ protected Builder() throws IOException { this(((ClientContext) null)); } - protected Builder(ClientContext clientContext) { + protected Builder(@Nullable ClientContext clientContext) { super(TetherStubSettings.newBuilder(clientContext)); } diff --git a/sdk-platform-java/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/ConnectionServiceStubSettings.java b/sdk-platform-java/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/ConnectionServiceStubSettings.java index 08f2534708ee..5edb2ba14160 100644 --- a/sdk-platform-java/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/ConnectionServiceStubSettings.java +++ b/sdk-platform-java/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/ConnectionServiceStubSettings.java @@ -57,6 +57,7 @@ import java.util.List; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -281,7 +282,7 @@ public static Builder newHttpJsonBuilder() { } /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { + public static Builder newBuilder(@Nullable ClientContext clientContext) { return new Builder(clientContext); } @@ -344,7 +345,7 @@ protected Builder() { this(((ClientContext) null)); } - protected Builder(ClientContext clientContext) { + protected Builder(@Nullable ClientContext clientContext) { super(clientContext); listConnectionsSettings = PagedCallSettings.newBuilder(LIST_CONNECTIONS_PAGE_STR_FACT); diff --git a/sdk-platform-java/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/TetherStubSettings.java b/sdk-platform-java/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/TetherStubSettings.java index f0a16c22b218..ed3885f83c71 100644 --- a/sdk-platform-java/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/TetherStubSettings.java +++ b/sdk-platform-java/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/TetherStubSettings.java @@ -43,6 +43,7 @@ import java.util.List; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -180,7 +181,7 @@ public static Builder newBuilder() { } /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { + public static Builder newBuilder(@Nullable ClientContext clientContext) { return new Builder(clientContext); } @@ -228,7 +229,7 @@ protected Builder() { this(((ClientContext) null)); } - protected Builder(ClientContext clientContext) { + protected Builder(@Nullable ClientContext clientContext) { super(clientContext); egressSettings = StreamingCallSettings.newBuilder(); diff --git a/sdk-platform-java/test/integration/goldens/asset/src/com/google/cloud/asset/v1/AssetServiceClient.java b/sdk-platform-java/test/integration/goldens/asset/src/com/google/cloud/asset/v1/AssetServiceClient.java index 9e2be2079cca..115891956adb 100644 --- a/sdk-platform-java/test/integration/goldens/asset/src/com/google/cloud/asset/v1/AssetServiceClient.java +++ b/sdk-platform-java/test/integration/goldens/asset/src/com/google/cloud/asset/v1/AssetServiceClient.java @@ -40,6 +40,7 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -486,7 +487,7 @@ @NullMarked @Generated("by gapic-generator-java") public class AssetServiceClient implements BackgroundResource { - private final AssetServiceSettings settings; + @Nullable private final AssetServiceSettings settings; private final AssetServiceStub stub; private final OperationsClient httpJsonOperationsClient; private final com.google.longrunning.OperationsClient operationsClient; @@ -533,6 +534,7 @@ protected AssetServiceClient(AssetServiceStub stub) { this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); } + @Nullable public final AssetServiceSettings getSettings() { return settings; } @@ -706,8 +708,7 @@ public final UnaryCallable exportAssetsCallable( * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListAssetsPagedResponse listAssets(ResourceName parent) { - ListAssetsRequest request = - ListAssetsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + ListAssetsRequest request = ListAssetsRequest.newBuilder().setParent(parent.toString()).build(); return listAssets(request); } @@ -1041,8 +1042,7 @@ public final UnaryCallable createFeedCallable() { * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Feed getFeed(FeedName name) { - GetFeedRequest request = - GetFeedRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + GetFeedRequest request = GetFeedRequest.newBuilder().setName(name.toString()).build(); return getFeed(request); } @@ -1318,8 +1318,7 @@ public final UnaryCallable updateFeedCallable() { * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final void deleteFeed(FeedName name) { - DeleteFeedRequest request = - DeleteFeedRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + DeleteFeedRequest request = DeleteFeedRequest.newBuilder().setName(name.toString()).build(); deleteFeed(request); } @@ -2212,7 +2211,7 @@ public final SavedQuery createSavedQuery( FolderName parent, SavedQuery savedQuery, String savedQueryId) { CreateSavedQueryRequest request = CreateSavedQueryRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) + .setParent(parent.toString()) .setSavedQuery(savedQuery) .setSavedQueryId(savedQueryId) .build(); @@ -2256,7 +2255,7 @@ public final SavedQuery createSavedQuery( OrganizationName parent, SavedQuery savedQuery, String savedQueryId) { CreateSavedQueryRequest request = CreateSavedQueryRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) + .setParent(parent.toString()) .setSavedQuery(savedQuery) .setSavedQueryId(savedQueryId) .build(); @@ -2300,7 +2299,7 @@ public final SavedQuery createSavedQuery( ProjectName parent, SavedQuery savedQuery, String savedQueryId) { CreateSavedQueryRequest request = CreateSavedQueryRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) + .setParent(parent.toString()) .setSavedQuery(savedQuery) .setSavedQueryId(savedQueryId) .build(); @@ -2440,7 +2439,7 @@ public final UnaryCallable createSavedQuery */ public final SavedQuery getSavedQuery(SavedQueryName name) { GetSavedQueryRequest request = - GetSavedQueryRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + GetSavedQueryRequest.newBuilder().setName(name.toString()).build(); return getSavedQuery(request); } @@ -2560,9 +2559,7 @@ public final UnaryCallable getSavedQueryCallab */ public final ListSavedQueriesPagedResponse listSavedQueries(FolderName parent) { ListSavedQueriesRequest request = - ListSavedQueriesRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .build(); + ListSavedQueriesRequest.newBuilder().setParent(parent.toString()).build(); return listSavedQueries(request); } @@ -2593,9 +2590,7 @@ public final ListSavedQueriesPagedResponse listSavedQueries(FolderName parent) { */ public final ListSavedQueriesPagedResponse listSavedQueries(OrganizationName parent) { ListSavedQueriesRequest request = - ListSavedQueriesRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .build(); + ListSavedQueriesRequest.newBuilder().setParent(parent.toString()).build(); return listSavedQueries(request); } @@ -2626,9 +2621,7 @@ public final ListSavedQueriesPagedResponse listSavedQueries(OrganizationName par */ public final ListSavedQueriesPagedResponse listSavedQueries(ProjectName parent) { ListSavedQueriesRequest request = - ListSavedQueriesRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .build(); + ListSavedQueriesRequest.newBuilder().setParent(parent.toString()).build(); return listSavedQueries(request); } @@ -2898,7 +2891,7 @@ public final UnaryCallable updateSavedQuery */ public final void deleteSavedQuery(SavedQueryName name) { DeleteSavedQueryRequest request = - DeleteSavedQueryRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + DeleteSavedQueryRequest.newBuilder().setName(name.toString()).build(); deleteSavedQuery(request); } @@ -3109,8 +3102,8 @@ public static class ListAssetsPage extends AbstractPage { private ListAssetsPage( - PageContext context, - ListAssetsResponse response) { + @Nullable PageContext context, + @Nullable ListAssetsResponse response) { super(context, response); } @@ -3120,14 +3113,14 @@ private static ListAssetsPage createEmptyPage() { @Override protected ListAssetsPage createPage( - PageContext context, - ListAssetsResponse response) { + @Nullable PageContext context, + @Nullable ListAssetsResponse response) { return new ListAssetsPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + @Nullable PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } @@ -3141,7 +3134,8 @@ public static class ListAssetsFixedSizeCollection ListAssetsPage, ListAssetsFixedSizeCollection> { - private ListAssetsFixedSizeCollection(List pages, int collectionSize) { + private ListAssetsFixedSizeCollection( + @Nullable List pages, int collectionSize) { super(pages, collectionSize); } @@ -3151,7 +3145,7 @@ private static ListAssetsFixedSizeCollection createEmptyCollection() { @Override protected ListAssetsFixedSizeCollection createCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { return new ListAssetsFixedSizeCollection(pages, collectionSize); } } @@ -3189,9 +3183,10 @@ public static class SearchAllResourcesPage SearchAllResourcesPage> { private SearchAllResourcesPage( - PageContext - context, - SearchAllResourcesResponse response) { + @Nullable + PageContext + context, + @Nullable SearchAllResourcesResponse response) { super(context, response); } @@ -3201,16 +3196,18 @@ private static SearchAllResourcesPage createEmptyPage() { @Override protected SearchAllResourcesPage createPage( - PageContext - context, - SearchAllResourcesResponse response) { + @Nullable + PageContext + context, + @Nullable SearchAllResourcesResponse response) { return new SearchAllResourcesPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext - context, + @Nullable + PageContext + context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } @@ -3225,7 +3222,7 @@ public static class SearchAllResourcesFixedSizeCollection SearchAllResourcesFixedSizeCollection> { private SearchAllResourcesFixedSizeCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { super(pages, collectionSize); } @@ -3235,7 +3232,7 @@ private static SearchAllResourcesFixedSizeCollection createEmptyCollection() { @Override protected SearchAllResourcesFixedSizeCollection createCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { return new SearchAllResourcesFixedSizeCollection(pages, collectionSize); } } @@ -3274,10 +3271,13 @@ public static class SearchAllIamPoliciesPage SearchAllIamPoliciesPage> { private SearchAllIamPoliciesPage( - PageContext< - SearchAllIamPoliciesRequest, SearchAllIamPoliciesResponse, IamPolicySearchResult> - context, - SearchAllIamPoliciesResponse response) { + @Nullable + PageContext< + SearchAllIamPoliciesRequest, + SearchAllIamPoliciesResponse, + IamPolicySearchResult> + context, + @Nullable SearchAllIamPoliciesResponse response) { super(context, response); } @@ -3287,18 +3287,24 @@ private static SearchAllIamPoliciesPage createEmptyPage() { @Override protected SearchAllIamPoliciesPage createPage( - PageContext< - SearchAllIamPoliciesRequest, SearchAllIamPoliciesResponse, IamPolicySearchResult> - context, - SearchAllIamPoliciesResponse response) { + @Nullable + PageContext< + SearchAllIamPoliciesRequest, + SearchAllIamPoliciesResponse, + IamPolicySearchResult> + context, + @Nullable SearchAllIamPoliciesResponse response) { return new SearchAllIamPoliciesPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext< - SearchAllIamPoliciesRequest, SearchAllIamPoliciesResponse, IamPolicySearchResult> - context, + @Nullable + PageContext< + SearchAllIamPoliciesRequest, + SearchAllIamPoliciesResponse, + IamPolicySearchResult> + context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } @@ -3313,7 +3319,7 @@ public static class SearchAllIamPoliciesFixedSizeCollection SearchAllIamPoliciesFixedSizeCollection> { private SearchAllIamPoliciesFixedSizeCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { super(pages, collectionSize); } @@ -3323,7 +3329,7 @@ private static SearchAllIamPoliciesFixedSizeCollection createEmptyCollection() { @Override protected SearchAllIamPoliciesFixedSizeCollection createCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { return new SearchAllIamPoliciesFixedSizeCollection(pages, collectionSize); } } @@ -3357,8 +3363,9 @@ public static class ListSavedQueriesPage ListSavedQueriesRequest, ListSavedQueriesResponse, SavedQuery, ListSavedQueriesPage> { private ListSavedQueriesPage( - PageContext context, - ListSavedQueriesResponse response) { + @Nullable + PageContext context, + @Nullable ListSavedQueriesResponse response) { super(context, response); } @@ -3368,14 +3375,16 @@ private static ListSavedQueriesPage createEmptyPage() { @Override protected ListSavedQueriesPage createPage( - PageContext context, - ListSavedQueriesResponse response) { + @Nullable + PageContext context, + @Nullable ListSavedQueriesResponse response) { return new ListSavedQueriesPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + @Nullable + PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } @@ -3390,7 +3399,7 @@ public static class ListSavedQueriesFixedSizeCollection ListSavedQueriesFixedSizeCollection> { private ListSavedQueriesFixedSizeCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { super(pages, collectionSize); } @@ -3400,7 +3409,7 @@ private static ListSavedQueriesFixedSizeCollection createEmptyCollection() { @Override protected ListSavedQueriesFixedSizeCollection createCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { return new ListSavedQueriesFixedSizeCollection(pages, collectionSize); } } diff --git a/sdk-platform-java/test/integration/goldens/asset/src/com/google/cloud/asset/v1/AssetServiceSettings.java b/sdk-platform-java/test/integration/goldens/asset/src/com/google/cloud/asset/v1/AssetServiceSettings.java index 137014ae6c20..afbaa3d5db51 100644 --- a/sdk-platform-java/test/integration/goldens/asset/src/com/google/cloud/asset/v1/AssetServiceSettings.java +++ b/sdk-platform-java/test/integration/goldens/asset/src/com/google/cloud/asset/v1/AssetServiceSettings.java @@ -42,6 +42,7 @@ import java.util.List; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -307,7 +308,7 @@ public static Builder newHttpJsonBuilder() { } /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { + public static Builder newBuilder(@Nullable ClientContext clientContext) { return new Builder(clientContext); } @@ -327,7 +328,7 @@ protected Builder() throws IOException { this(((ClientContext) null)); } - protected Builder(ClientContext clientContext) { + protected Builder(@Nullable ClientContext clientContext) { super(AssetServiceStubSettings.newBuilder(clientContext)); } diff --git a/sdk-platform-java/test/integration/goldens/asset/src/com/google/cloud/asset/v1/FeedName.java b/sdk-platform-java/test/integration/goldens/asset/src/com/google/cloud/asset/v1/FeedName.java index ed33edd129ec..f8be0272cebe 100644 --- a/sdk-platform-java/test/integration/goldens/asset/src/com/google/cloud/asset/v1/FeedName.java +++ b/sdk-platform-java/test/integration/goldens/asset/src/com/google/cloud/asset/v1/FeedName.java @@ -27,6 +27,7 @@ import java.util.Objects; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. @NullMarked @@ -150,6 +151,7 @@ public static String formatOrganizationFeedName(String organization, String feed .toString(); } + @Nullable public static FeedName parse(String formattedString) { if (formattedString.isEmpty()) { return null; @@ -175,7 +177,7 @@ public static List parseList(List formattedStrings) { return list; } - public static List toStringList(List values) { + public static List toStringList(List<@Nullable FeedName> values) { List list = new ArrayList<>(values.size()); for (FeedName value : values) { if (value == null) { @@ -228,7 +230,7 @@ public String toString() { } @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (o == this) { return true; } diff --git a/sdk-platform-java/test/integration/goldens/asset/src/com/google/cloud/asset/v1/FolderName.java b/sdk-platform-java/test/integration/goldens/asset/src/com/google/cloud/asset/v1/FolderName.java index 29369cb83590..ddb7beeba993 100644 --- a/sdk-platform-java/test/integration/goldens/asset/src/com/google/cloud/asset/v1/FolderName.java +++ b/sdk-platform-java/test/integration/goldens/asset/src/com/google/cloud/asset/v1/FolderName.java @@ -26,6 +26,7 @@ import java.util.Objects; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. @NullMarked @@ -65,6 +66,7 @@ public static String format(String folder) { return newBuilder().setFolder(folder).build().toString(); } + @Nullable public static FolderName parse(String formattedString) { if (formattedString.isEmpty()) { return null; @@ -83,7 +85,7 @@ public static List parseList(List formattedStrings) { return list; } - public static List toStringList(List values) { + public static List toStringList(List<@Nullable FolderName> values) { List list = new ArrayList<>(values.size()); for (FolderName value : values) { if (value == null) { @@ -125,7 +127,7 @@ public String toString() { } @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (o == this) { return true; } diff --git a/sdk-platform-java/test/integration/goldens/asset/src/com/google/cloud/asset/v1/OrganizationName.java b/sdk-platform-java/test/integration/goldens/asset/src/com/google/cloud/asset/v1/OrganizationName.java index 0cadf25e6184..9610bc691334 100644 --- a/sdk-platform-java/test/integration/goldens/asset/src/com/google/cloud/asset/v1/OrganizationName.java +++ b/sdk-platform-java/test/integration/goldens/asset/src/com/google/cloud/asset/v1/OrganizationName.java @@ -26,6 +26,7 @@ import java.util.Objects; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. @NullMarked @@ -65,6 +66,7 @@ public static String format(String organization) { return newBuilder().setOrganization(organization).build().toString(); } + @Nullable public static OrganizationName parse(String formattedString) { if (formattedString.isEmpty()) { return null; @@ -83,7 +85,7 @@ public static List parseList(List formattedStrings) { return list; } - public static List toStringList(List values) { + public static List toStringList(List<@Nullable OrganizationName> values) { List list = new ArrayList<>(values.size()); for (OrganizationName value : values) { if (value == null) { @@ -125,7 +127,7 @@ public String toString() { } @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (o == this) { return true; } diff --git a/sdk-platform-java/test/integration/goldens/asset/src/com/google/cloud/asset/v1/ProjectName.java b/sdk-platform-java/test/integration/goldens/asset/src/com/google/cloud/asset/v1/ProjectName.java index e659b684f3f6..e3bbdc9422fa 100644 --- a/sdk-platform-java/test/integration/goldens/asset/src/com/google/cloud/asset/v1/ProjectName.java +++ b/sdk-platform-java/test/integration/goldens/asset/src/com/google/cloud/asset/v1/ProjectName.java @@ -26,6 +26,7 @@ import java.util.Objects; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. @NullMarked @@ -65,6 +66,7 @@ public static String format(String project) { return newBuilder().setProject(project).build().toString(); } + @Nullable public static ProjectName parse(String formattedString) { if (formattedString.isEmpty()) { return null; @@ -83,7 +85,7 @@ public static List parseList(List formattedStrings) { return list; } - public static List toStringList(List values) { + public static List toStringList(List<@Nullable ProjectName> values) { List list = new ArrayList<>(values.size()); for (ProjectName value : values) { if (value == null) { @@ -125,7 +127,7 @@ public String toString() { } @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (o == this) { return true; } diff --git a/sdk-platform-java/test/integration/goldens/asset/src/com/google/cloud/asset/v1/SavedQueryName.java b/sdk-platform-java/test/integration/goldens/asset/src/com/google/cloud/asset/v1/SavedQueryName.java index e565aefb9835..2b5c2671be2b 100644 --- a/sdk-platform-java/test/integration/goldens/asset/src/com/google/cloud/asset/v1/SavedQueryName.java +++ b/sdk-platform-java/test/integration/goldens/asset/src/com/google/cloud/asset/v1/SavedQueryName.java @@ -27,6 +27,7 @@ import java.util.Objects; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. @NullMarked @@ -159,6 +160,7 @@ public static String formatOrganizationSavedQueryName(String organization, Strin .toString(); } + @Nullable public static SavedQueryName parse(String formattedString) { if (formattedString.isEmpty()) { return null; @@ -185,7 +187,7 @@ public static List parseList(List formattedStrings) { return list; } - public static List toStringList(List values) { + public static List toStringList(List<@Nullable SavedQueryName> values) { List list = new ArrayList<>(values.size()); for (SavedQueryName value : values) { if (value == null) { @@ -238,7 +240,7 @@ public String toString() { } @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (o == this) { return true; } diff --git a/sdk-platform-java/test/integration/goldens/asset/src/com/google/cloud/asset/v1/stub/AssetServiceStub.java b/sdk-platform-java/test/integration/goldens/asset/src/com/google/cloud/asset/v1/stub/AssetServiceStub.java index d38f4b4b7703..8b272b0a58e7 100644 --- a/sdk-platform-java/test/integration/goldens/asset/src/com/google/cloud/asset/v1/stub/AssetServiceStub.java +++ b/sdk-platform-java/test/integration/goldens/asset/src/com/google/cloud/asset/v1/stub/AssetServiceStub.java @@ -64,6 +64,7 @@ import com.google.protobuf.Empty; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -75,11 +76,12 @@ @Generated("by gapic-generator-java") public abstract class AssetServiceStub implements BackgroundResource { - public OperationsStub getOperationsStub() { + public @Nullable OperationsStub getOperationsStub() { return null; } - public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() { + public com.google.api.gax.httpjson.longrunning.stub.@Nullable OperationsStub + getHttpJsonOperationsStub() { return null; } diff --git a/sdk-platform-java/test/integration/goldens/asset/src/com/google/cloud/asset/v1/stub/AssetServiceStubSettings.java b/sdk-platform-java/test/integration/goldens/asset/src/com/google/cloud/asset/v1/stub/AssetServiceStubSettings.java index 14ec11890d20..228bd9400640 100644 --- a/sdk-platform-java/test/integration/goldens/asset/src/com/google/cloud/asset/v1/stub/AssetServiceStubSettings.java +++ b/sdk-platform-java/test/integration/goldens/asset/src/com/google/cloud/asset/v1/stub/AssetServiceStubSettings.java @@ -101,6 +101,7 @@ import java.util.List; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -690,7 +691,7 @@ public static Builder newHttpJsonBuilder() { } /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { + public static Builder newBuilder(@Nullable ClientContext clientContext) { return new Builder(clientContext); } @@ -892,7 +893,7 @@ protected Builder() { this(((ClientContext) null)); } - protected Builder(ClientContext clientContext) { + protected Builder(@Nullable ClientContext clientContext) { super(clientContext); exportAssetsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); diff --git a/sdk-platform-java/test/integration/goldens/bigtable/src/com/google/bigtable/v2/InstanceName.java b/sdk-platform-java/test/integration/goldens/bigtable/src/com/google/bigtable/v2/InstanceName.java index 6e36641b3114..1e835fb48b36 100644 --- a/sdk-platform-java/test/integration/goldens/bigtable/src/com/google/bigtable/v2/InstanceName.java +++ b/sdk-platform-java/test/integration/goldens/bigtable/src/com/google/bigtable/v2/InstanceName.java @@ -26,6 +26,7 @@ import java.util.Objects; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. @NullMarked @@ -72,6 +73,7 @@ public static String format(String project, String instance) { return newBuilder().setProject(project).setInstance(instance).build().toString(); } + @Nullable public static InstanceName parse(String formattedString) { if (formattedString.isEmpty()) { return null; @@ -90,7 +92,7 @@ public static List parseList(List formattedStrings) { return list; } - public static List toStringList(List values) { + public static List toStringList(List<@Nullable InstanceName> values) { List list = new ArrayList<>(values.size()); for (InstanceName value : values) { if (value == null) { @@ -135,7 +137,7 @@ public String toString() { } @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (o == this) { return true; } diff --git a/sdk-platform-java/test/integration/goldens/bigtable/src/com/google/bigtable/v2/TableName.java b/sdk-platform-java/test/integration/goldens/bigtable/src/com/google/bigtable/v2/TableName.java index 200ca73023f9..54f645694594 100644 --- a/sdk-platform-java/test/integration/goldens/bigtable/src/com/google/bigtable/v2/TableName.java +++ b/sdk-platform-java/test/integration/goldens/bigtable/src/com/google/bigtable/v2/TableName.java @@ -26,6 +26,7 @@ import java.util.Objects; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. @NullMarked @@ -85,6 +86,7 @@ public static String format(String project, String instance, String table) { .toString(); } + @Nullable public static TableName parse(String formattedString) { if (formattedString.isEmpty()) { return null; @@ -103,7 +105,7 @@ public static List parseList(List formattedStrings) { return list; } - public static List toStringList(List values) { + public static List toStringList(List<@Nullable TableName> values) { List list = new ArrayList<>(values.size()); for (TableName value : values) { if (value == null) { @@ -152,7 +154,7 @@ public String toString() { } @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (o == this) { return true; } diff --git a/sdk-platform-java/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/BaseBigtableDataClient.java b/sdk-platform-java/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/BaseBigtableDataClient.java index f4b922e30f27..287a01b9dce2 100644 --- a/sdk-platform-java/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/BaseBigtableDataClient.java +++ b/sdk-platform-java/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/BaseBigtableDataClient.java @@ -46,6 +46,7 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -239,7 +240,7 @@ @NullMarked @Generated("by gapic-generator-java") public class BaseBigtableDataClient implements BackgroundResource { - private final BaseBigtableDataSettings settings; + @Nullable private final BaseBigtableDataSettings settings; private final BigtableStub stub; /** Constructs an instance of BaseBigtableDataClient with default settings. */ @@ -279,6 +280,7 @@ protected BaseBigtableDataClient(BigtableStub stub) { this.stub = stub; } + @Nullable public final BaseBigtableDataSettings getSettings() { return settings; } @@ -390,7 +392,7 @@ public final MutateRowResponse mutateRow( TableName tableName, ByteString rowKey, List mutations) { MutateRowRequest request = MutateRowRequest.newBuilder() - .setTableName(tableName == null ? null : tableName.toString()) + .setTableName(tableName.toString()) .setRowKey(rowKey) .addAllMutations(mutations) .build(); @@ -476,7 +478,7 @@ public final MutateRowResponse mutateRow( TableName tableName, ByteString rowKey, List mutations, String appProfileId) { MutateRowRequest request = MutateRowRequest.newBuilder() - .setTableName(tableName == null ? null : tableName.toString()) + .setTableName(tableName.toString()) .setRowKey(rowKey) .addAllMutations(mutations) .setAppProfileId(appProfileId) @@ -675,7 +677,7 @@ public final CheckAndMutateRowResponse checkAndMutateRow( List falseMutations) { CheckAndMutateRowRequest request = CheckAndMutateRowRequest.newBuilder() - .setTableName(tableName == null ? null : tableName.toString()) + .setTableName(tableName.toString()) .setRowKey(rowKey) .setPredicateFilter(predicateFilter) .addAllTrueMutations(trueMutations) @@ -795,7 +797,7 @@ public final CheckAndMutateRowResponse checkAndMutateRow( String appProfileId) { CheckAndMutateRowRequest request = CheckAndMutateRowRequest.newBuilder() - .setTableName(tableName == null ? null : tableName.toString()) + .setTableName(tableName.toString()) .setRowKey(rowKey) .setPredicateFilter(predicateFilter) .addAllTrueMutations(trueMutations) @@ -959,8 +961,7 @@ public final CheckAndMutateRowResponse checkAndMutateRow(CheckAndMutateRowReques * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final PingAndWarmResponse pingAndWarm(InstanceName name) { - PingAndWarmRequest request = - PingAndWarmRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + PingAndWarmRequest request = PingAndWarmRequest.newBuilder().setName(name.toString()).build(); return pingAndWarm(request); } @@ -1021,7 +1022,7 @@ public final PingAndWarmResponse pingAndWarm(String name) { public final PingAndWarmResponse pingAndWarm(InstanceName name, String appProfileId) { PingAndWarmRequest request = PingAndWarmRequest.newBuilder() - .setName(name == null ? null : name.toString()) + .setName(name.toString()) .setAppProfileId(appProfileId) .build(); return pingAndWarm(request); @@ -1157,7 +1158,7 @@ public final ReadModifyWriteRowResponse readModifyWriteRow( TableName tableName, ByteString rowKey, List rules) { ReadModifyWriteRowRequest request = ReadModifyWriteRowRequest.newBuilder() - .setTableName(tableName == null ? null : tableName.toString()) + .setTableName(tableName.toString()) .setRowKey(rowKey) .addAllRules(rules) .build(); @@ -1253,7 +1254,7 @@ public final ReadModifyWriteRowResponse readModifyWriteRow( String appProfileId) { ReadModifyWriteRowRequest request = ReadModifyWriteRowRequest.newBuilder() - .setTableName(tableName == null ? null : tableName.toString()) + .setTableName(tableName.toString()) .setRowKey(rowKey) .addAllRules(rules) .setAppProfileId(appProfileId) diff --git a/sdk-platform-java/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/BaseBigtableDataSettings.java b/sdk-platform-java/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/BaseBigtableDataSettings.java index 728748a3dd7a..b9161e4c84e2 100644 --- a/sdk-platform-java/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/BaseBigtableDataSettings.java +++ b/sdk-platform-java/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/BaseBigtableDataSettings.java @@ -46,6 +46,7 @@ import java.util.List; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -183,7 +184,7 @@ public static Builder newBuilder() { } /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { + public static Builder newBuilder(@Nullable ClientContext clientContext) { return new Builder(clientContext); } @@ -203,7 +204,7 @@ protected Builder() throws IOException { this(((ClientContext) null)); } - protected Builder(ClientContext clientContext) { + protected Builder(@Nullable ClientContext clientContext) { super(BigtableStubSettings.newBuilder(clientContext)); } diff --git a/sdk-platform-java/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/stub/BigtableStubSettings.java b/sdk-platform-java/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/stub/BigtableStubSettings.java index 680112fc2920..6ccde1719232 100644 --- a/sdk-platform-java/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/stub/BigtableStubSettings.java +++ b/sdk-platform-java/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/stub/BigtableStubSettings.java @@ -56,6 +56,7 @@ import java.util.List; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -240,7 +241,7 @@ public static Builder newBuilder() { } /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { + public static Builder newBuilder(@Nullable ClientContext clientContext) { return new Builder(clientContext); } @@ -362,7 +363,7 @@ protected Builder() { this(((ClientContext) null)); } - protected Builder(ClientContext clientContext) { + protected Builder(@Nullable ClientContext clientContext) { super(clientContext); readRowsSettings = ServerStreamingCallSettings.newBuilder(); diff --git a/sdk-platform-java/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/AddressesClient.java b/sdk-platform-java/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/AddressesClient.java index 7ae225f7cdfb..08fd5982c1a1 100644 --- a/sdk-platform-java/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/AddressesClient.java +++ b/sdk-platform-java/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/AddressesClient.java @@ -35,6 +35,7 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -190,7 +191,7 @@ @NullMarked @Generated("by gapic-generator-java") public class AddressesClient implements BackgroundResource { - private final AddressesSettings settings; + @Nullable private final AddressesSettings settings; private final AddressesStub stub; /** Constructs an instance of AddressesClient with default settings. */ @@ -228,6 +229,7 @@ protected AddressesClient(AddressesStub stub) { this.stub = stub; } + @Nullable public final AddressesSettings getSettings() { return settings; } @@ -857,12 +859,13 @@ public static class AggregatedListPage AggregatedListPage> { private AggregatedListPage( - PageContext< - AggregatedListAddressesRequest, - AddressAggregatedList, - Map.Entry> - context, - AddressAggregatedList response) { + @Nullable + PageContext< + AggregatedListAddressesRequest, + AddressAggregatedList, + Map.Entry> + context, + @Nullable AddressAggregatedList response) { super(context, response); } @@ -872,22 +875,24 @@ private static AggregatedListPage createEmptyPage() { @Override protected AggregatedListPage createPage( - PageContext< - AggregatedListAddressesRequest, - AddressAggregatedList, - Map.Entry> - context, - AddressAggregatedList response) { + @Nullable + PageContext< + AggregatedListAddressesRequest, + AddressAggregatedList, + Map.Entry> + context, + @Nullable AddressAggregatedList response) { return new AggregatedListPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext< - AggregatedListAddressesRequest, - AddressAggregatedList, - Map.Entry> - context, + @Nullable + PageContext< + AggregatedListAddressesRequest, + AddressAggregatedList, + Map.Entry> + context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } @@ -901,7 +906,8 @@ public static class AggregatedListFixedSizeCollection AggregatedListPage, AggregatedListFixedSizeCollection> { - private AggregatedListFixedSizeCollection(List pages, int collectionSize) { + private AggregatedListFixedSizeCollection( + @Nullable List pages, int collectionSize) { super(pages, collectionSize); } @@ -911,7 +917,7 @@ private static AggregatedListFixedSizeCollection createEmptyCollection() { @Override protected AggregatedListFixedSizeCollection createCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { return new AggregatedListFixedSizeCollection(pages, collectionSize); } } @@ -938,7 +944,8 @@ public static class ListPage extends AbstractPage { private ListPage( - PageContext context, AddressList response) { + @Nullable PageContext context, + @Nullable AddressList response) { super(context, response); } @@ -948,13 +955,14 @@ private static ListPage createEmptyPage() { @Override protected ListPage createPage( - PageContext context, AddressList response) { + @Nullable PageContext context, + @Nullable AddressList response) { return new ListPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + @Nullable PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } @@ -964,7 +972,7 @@ public static class ListFixedSizeCollection extends AbstractFixedSizeCollection< ListAddressesRequest, AddressList, Address, ListPage, ListFixedSizeCollection> { - private ListFixedSizeCollection(List pages, int collectionSize) { + private ListFixedSizeCollection(@Nullable List pages, int collectionSize) { super(pages, collectionSize); } @@ -973,7 +981,8 @@ private static ListFixedSizeCollection createEmptyCollection() { } @Override - protected ListFixedSizeCollection createCollection(List pages, int collectionSize) { + protected ListFixedSizeCollection createCollection( + @Nullable List pages, int collectionSize) { return new ListFixedSizeCollection(pages, collectionSize); } } diff --git a/sdk-platform-java/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/AddressesSettings.java b/sdk-platform-java/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/AddressesSettings.java index 1d092e884e40..8c3c3ff6e498 100644 --- a/sdk-platform-java/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/AddressesSettings.java +++ b/sdk-platform-java/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/AddressesSettings.java @@ -36,6 +36,7 @@ import java.util.List; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -193,7 +194,7 @@ public static Builder newBuilder() { } /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { + public static Builder newBuilder(@Nullable ClientContext clientContext) { return new Builder(clientContext); } @@ -213,7 +214,7 @@ protected Builder() throws IOException { this(((ClientContext) null)); } - protected Builder(ClientContext clientContext) { + protected Builder(@Nullable ClientContext clientContext) { super(AddressesStubSettings.newBuilder(clientContext)); } diff --git a/sdk-platform-java/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/RegionOperationsClient.java b/sdk-platform-java/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/RegionOperationsClient.java index 8531bab2388b..cf1e94a7f08e 100644 --- a/sdk-platform-java/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/RegionOperationsClient.java +++ b/sdk-platform-java/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/RegionOperationsClient.java @@ -24,6 +24,7 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -140,7 +141,7 @@ @NullMarked @Generated("by gapic-generator-java") public class RegionOperationsClient implements BackgroundResource { - private final RegionOperationsSettings settings; + @Nullable private final RegionOperationsSettings settings; private final RegionOperationsStub stub; /** Constructs an instance of RegionOperationsClient with default settings. */ @@ -180,6 +181,7 @@ protected RegionOperationsClient(RegionOperationsStub stub) { this.stub = stub; } + @Nullable public final RegionOperationsSettings getSettings() { return settings; } diff --git a/sdk-platform-java/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/RegionOperationsSettings.java b/sdk-platform-java/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/RegionOperationsSettings.java index 4104ee49c9f2..f55256c0f801 100644 --- a/sdk-platform-java/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/RegionOperationsSettings.java +++ b/sdk-platform-java/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/RegionOperationsSettings.java @@ -31,6 +31,7 @@ import java.util.List; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -141,7 +142,7 @@ public static Builder newBuilder() { } /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { + public static Builder newBuilder(@Nullable ClientContext clientContext) { return new Builder(clientContext); } @@ -161,7 +162,7 @@ protected Builder() throws IOException { this(((ClientContext) null)); } - protected Builder(ClientContext clientContext) { + protected Builder(@Nullable ClientContext clientContext) { super(RegionOperationsStubSettings.newBuilder(clientContext)); } diff --git a/sdk-platform-java/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/AddressesStubSettings.java b/sdk-platform-java/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/AddressesStubSettings.java index 114d5a8d9b4a..33ffba8b4494 100644 --- a/sdk-platform-java/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/AddressesStubSettings.java +++ b/sdk-platform-java/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/AddressesStubSettings.java @@ -65,6 +65,7 @@ import java.util.Map; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -384,7 +385,7 @@ public static Builder newBuilder() { } /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { + public static Builder newBuilder(@Nullable ClientContext clientContext) { return new Builder(clientContext); } @@ -470,7 +471,7 @@ protected Builder() { this(((ClientContext) null)); } - protected Builder(ClientContext clientContext) { + protected Builder(@Nullable ClientContext clientContext) { super(clientContext); aggregatedListSettings = PagedCallSettings.newBuilder(AGGREGATED_LIST_PAGE_STR_FACT); diff --git a/sdk-platform-java/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/RegionOperationsStubSettings.java b/sdk-platform-java/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/RegionOperationsStubSettings.java index 1c66a2b510e2..d1ec2ba73fb1 100644 --- a/sdk-platform-java/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/RegionOperationsStubSettings.java +++ b/sdk-platform-java/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/RegionOperationsStubSettings.java @@ -44,6 +44,7 @@ import java.util.List; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -190,7 +191,7 @@ public static Builder newBuilder() { } /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { + public static Builder newBuilder(@Nullable ClientContext clientContext) { return new Builder(clientContext); } @@ -263,7 +264,7 @@ protected Builder() { this(((ClientContext) null)); } - protected Builder(ClientContext clientContext) { + protected Builder(@Nullable ClientContext clientContext) { super(clientContext); getSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); diff --git a/sdk-platform-java/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/IamCredentialsClient.java b/sdk-platform-java/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/IamCredentialsClient.java index 809d9f7bc606..cd2358edb5f2 100644 --- a/sdk-platform-java/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/IamCredentialsClient.java +++ b/sdk-platform-java/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/IamCredentialsClient.java @@ -27,6 +27,7 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -202,7 +203,7 @@ @NullMarked @Generated("by gapic-generator-java") public class IamCredentialsClient implements BackgroundResource { - private final IamCredentialsSettings settings; + @Nullable private final IamCredentialsSettings settings; private final IamCredentialsStub stub; /** Constructs an instance of IamCredentialsClient with default settings. */ @@ -242,6 +243,7 @@ protected IamCredentialsClient(IamCredentialsStub stub) { this.stub = stub; } + @Nullable public final IamCredentialsSettings getSettings() { return settings; } @@ -296,7 +298,7 @@ public final GenerateAccessTokenResponse generateAccessToken( ServiceAccountName name, List delegates, List scope, Duration lifetime) { GenerateAccessTokenRequest request = GenerateAccessTokenRequest.newBuilder() - .setName(name == null ? null : name.toString()) + .setName(name.toString()) .addAllDelegates(delegates) .addAllScope(scope) .setLifetime(lifetime) @@ -465,7 +467,7 @@ public final GenerateIdTokenResponse generateIdToken( ServiceAccountName name, List delegates, String audience, boolean includeEmail) { GenerateIdTokenRequest request = GenerateIdTokenRequest.newBuilder() - .setName(name == null ? null : name.toString()) + .setName(name.toString()) .addAllDelegates(delegates) .setAudience(audience) .setIncludeEmail(includeEmail) @@ -627,7 +629,7 @@ public final SignBlobResponse signBlob( ServiceAccountName name, List delegates, ByteString payload) { SignBlobRequest request = SignBlobRequest.newBuilder() - .setName(name == null ? null : name.toString()) + .setName(name.toString()) .addAllDelegates(delegates) .setPayload(payload) .build(); @@ -778,7 +780,7 @@ public final SignJwtResponse signJwt( ServiceAccountName name, List delegates, String payload) { SignJwtRequest request = SignJwtRequest.newBuilder() - .setName(name == null ? null : name.toString()) + .setName(name.toString()) .addAllDelegates(delegates) .setPayload(payload) .build(); diff --git a/sdk-platform-java/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/IamCredentialsSettings.java b/sdk-platform-java/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/IamCredentialsSettings.java index 6c6d18c2ef46..cb4a5e3dc355 100644 --- a/sdk-platform-java/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/IamCredentialsSettings.java +++ b/sdk-platform-java/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/IamCredentialsSettings.java @@ -33,6 +33,7 @@ import java.util.List; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -167,7 +168,7 @@ public static Builder newHttpJsonBuilder() { } /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { + public static Builder newBuilder(@Nullable ClientContext clientContext) { return new Builder(clientContext); } @@ -187,7 +188,7 @@ protected Builder() throws IOException { this(((ClientContext) null)); } - protected Builder(ClientContext clientContext) { + protected Builder(@Nullable ClientContext clientContext) { super(IamCredentialsStubSettings.newBuilder(clientContext)); } diff --git a/sdk-platform-java/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/ServiceAccountName.java b/sdk-platform-java/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/ServiceAccountName.java index 29071fff8871..f49a33025e1b 100644 --- a/sdk-platform-java/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/ServiceAccountName.java +++ b/sdk-platform-java/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/ServiceAccountName.java @@ -26,6 +26,7 @@ import java.util.Objects; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. @NullMarked @@ -72,6 +73,7 @@ public static String format(String project, String serviceAccount) { return newBuilder().setProject(project).setServiceAccount(serviceAccount).build().toString(); } + @Nullable public static ServiceAccountName parse(String formattedString) { if (formattedString.isEmpty()) { return null; @@ -90,7 +92,7 @@ public static List parseList(List formattedStrings) return list; } - public static List toStringList(List values) { + public static List toStringList(List<@Nullable ServiceAccountName> values) { List list = new ArrayList<>(values.size()); for (ServiceAccountName value : values) { if (value == null) { @@ -136,7 +138,7 @@ public String toString() { } @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (o == this) { return true; } diff --git a/sdk-platform-java/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/stub/IamCredentialsStubSettings.java b/sdk-platform-java/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/stub/IamCredentialsStubSettings.java index 21c092c1e3a2..9245db1a499b 100644 --- a/sdk-platform-java/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/stub/IamCredentialsStubSettings.java +++ b/sdk-platform-java/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/stub/IamCredentialsStubSettings.java @@ -53,6 +53,7 @@ import java.util.List; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -241,7 +242,7 @@ public static Builder newHttpJsonBuilder() { } /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { + public static Builder newBuilder(@Nullable ClientContext clientContext) { return new Builder(clientContext); } @@ -310,7 +311,7 @@ protected Builder() { this(((ClientContext) null)); } - protected Builder(ClientContext clientContext) { + protected Builder(@Nullable ClientContext clientContext) { super(clientContext); generateAccessTokenSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); diff --git a/sdk-platform-java/test/integration/goldens/iam/src/com/google/iam/v1/IAMPolicyClient.java b/sdk-platform-java/test/integration/goldens/iam/src/com/google/iam/v1/IAMPolicyClient.java index 0599d925334f..35705196cce2 100644 --- a/sdk-platform-java/test/integration/goldens/iam/src/com/google/iam/v1/IAMPolicyClient.java +++ b/sdk-platform-java/test/integration/goldens/iam/src/com/google/iam/v1/IAMPolicyClient.java @@ -24,6 +24,7 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -168,7 +169,7 @@ @NullMarked @Generated("by gapic-generator-java") public class IAMPolicyClient implements BackgroundResource { - private final IAMPolicySettings settings; + @Nullable private final IAMPolicySettings settings; private final IAMPolicyStub stub; /** Constructs an instance of IAMPolicyClient with default settings. */ @@ -206,6 +207,7 @@ protected IAMPolicyClient(IAMPolicyStub stub) { this.stub = stub; } + @Nullable public final IAMPolicySettings getSettings() { return settings; } diff --git a/sdk-platform-java/test/integration/goldens/iam/src/com/google/iam/v1/IAMPolicySettings.java b/sdk-platform-java/test/integration/goldens/iam/src/com/google/iam/v1/IAMPolicySettings.java index 3a3621b77e58..af5661261f09 100644 --- a/sdk-platform-java/test/integration/goldens/iam/src/com/google/iam/v1/IAMPolicySettings.java +++ b/sdk-platform-java/test/integration/goldens/iam/src/com/google/iam/v1/IAMPolicySettings.java @@ -31,6 +31,7 @@ import java.util.List; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -144,7 +145,7 @@ public static Builder newBuilder() { } /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { + public static Builder newBuilder(@Nullable ClientContext clientContext) { return new Builder(clientContext); } @@ -164,7 +165,7 @@ protected Builder() throws IOException { this(((ClientContext) null)); } - protected Builder(ClientContext clientContext) { + protected Builder(@Nullable ClientContext clientContext) { super(IAMPolicyStubSettings.newBuilder(clientContext)); } diff --git a/sdk-platform-java/test/integration/goldens/iam/src/com/google/iam/v1/stub/IAMPolicyStubSettings.java b/sdk-platform-java/test/integration/goldens/iam/src/com/google/iam/v1/stub/IAMPolicyStubSettings.java index 7761748c268a..e3b801291ff9 100644 --- a/sdk-platform-java/test/integration/goldens/iam/src/com/google/iam/v1/stub/IAMPolicyStubSettings.java +++ b/sdk-platform-java/test/integration/goldens/iam/src/com/google/iam/v1/stub/IAMPolicyStubSettings.java @@ -46,6 +46,7 @@ import java.util.List; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -193,7 +194,7 @@ public static Builder newBuilder() { } /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { + public static Builder newBuilder(@Nullable ClientContext clientContext) { return new Builder(clientContext); } @@ -257,7 +258,7 @@ protected Builder() { this(((ClientContext) null)); } - protected Builder(ClientContext clientContext) { + protected Builder(@Nullable ClientContext clientContext) { super(clientContext); setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); diff --git a/sdk-platform-java/test/integration/goldens/kms/src/com/google/cloud/kms/v1/CryptoKeyName.java b/sdk-platform-java/test/integration/goldens/kms/src/com/google/cloud/kms/v1/CryptoKeyName.java index 9926a26800fa..5a901f3d8b95 100644 --- a/sdk-platform-java/test/integration/goldens/kms/src/com/google/cloud/kms/v1/CryptoKeyName.java +++ b/sdk-platform-java/test/integration/goldens/kms/src/com/google/cloud/kms/v1/CryptoKeyName.java @@ -26,6 +26,7 @@ import java.util.Objects; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. @NullMarked @@ -99,6 +100,7 @@ public static String format(String project, String location, String keyRing, Str .toString(); } + @Nullable public static CryptoKeyName parse(String formattedString) { if (formattedString.isEmpty()) { return null; @@ -121,7 +123,7 @@ public static List parseList(List formattedStrings) { return list; } - public static List toStringList(List values) { + public static List toStringList(List<@Nullable CryptoKeyName> values) { List list = new ArrayList<>(values.size()); for (CryptoKeyName value : values) { if (value == null) { @@ -173,7 +175,7 @@ public String toString() { } @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (o == this) { return true; } diff --git a/sdk-platform-java/test/integration/goldens/kms/src/com/google/cloud/kms/v1/CryptoKeyVersionName.java b/sdk-platform-java/test/integration/goldens/kms/src/com/google/cloud/kms/v1/CryptoKeyVersionName.java index c874db01eba9..41704d81d91d 100644 --- a/sdk-platform-java/test/integration/goldens/kms/src/com/google/cloud/kms/v1/CryptoKeyVersionName.java +++ b/sdk-platform-java/test/integration/goldens/kms/src/com/google/cloud/kms/v1/CryptoKeyVersionName.java @@ -26,6 +26,7 @@ import java.util.Objects; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. @NullMarked @@ -109,6 +110,7 @@ public static String format( .toString(); } + @Nullable public static CryptoKeyVersionName parse(String formattedString) { if (formattedString.isEmpty()) { return null; @@ -132,7 +134,7 @@ public static List parseList(List formattedStrings return list; } - public static List toStringList(List values) { + public static List toStringList(List<@Nullable CryptoKeyVersionName> values) { List list = new ArrayList<>(values.size()); for (CryptoKeyVersionName value : values) { if (value == null) { @@ -196,7 +198,7 @@ public String toString() { } @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (o == this) { return true; } diff --git a/sdk-platform-java/test/integration/goldens/kms/src/com/google/cloud/kms/v1/ImportJobName.java b/sdk-platform-java/test/integration/goldens/kms/src/com/google/cloud/kms/v1/ImportJobName.java index 11769b9fcaec..200f88d74b5e 100644 --- a/sdk-platform-java/test/integration/goldens/kms/src/com/google/cloud/kms/v1/ImportJobName.java +++ b/sdk-platform-java/test/integration/goldens/kms/src/com/google/cloud/kms/v1/ImportJobName.java @@ -26,6 +26,7 @@ import java.util.Objects; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. @NullMarked @@ -99,6 +100,7 @@ public static String format(String project, String location, String keyRing, Str .toString(); } + @Nullable public static ImportJobName parse(String formattedString) { if (formattedString.isEmpty()) { return null; @@ -121,7 +123,7 @@ public static List parseList(List formattedStrings) { return list; } - public static List toStringList(List values) { + public static List toStringList(List<@Nullable ImportJobName> values) { List list = new ArrayList<>(values.size()); for (ImportJobName value : values) { if (value == null) { @@ -173,7 +175,7 @@ public String toString() { } @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (o == this) { return true; } diff --git a/sdk-platform-java/test/integration/goldens/kms/src/com/google/cloud/kms/v1/KeyManagementServiceClient.java b/sdk-platform-java/test/integration/goldens/kms/src/com/google/cloud/kms/v1/KeyManagementServiceClient.java index 2346dcd09a38..75011b3d0deb 100644 --- a/sdk-platform-java/test/integration/goldens/kms/src/com/google/cloud/kms/v1/KeyManagementServiceClient.java +++ b/sdk-platform-java/test/integration/goldens/kms/src/com/google/cloud/kms/v1/KeyManagementServiceClient.java @@ -43,6 +43,7 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -634,7 +635,7 @@ @NullMarked @Generated("by gapic-generator-java") public class KeyManagementServiceClient implements BackgroundResource { - private final KeyManagementServiceSettings settings; + @Nullable private final KeyManagementServiceSettings settings; private final KeyManagementServiceStub stub; /** Constructs an instance of KeyManagementServiceClient with default settings. */ @@ -674,6 +675,7 @@ protected KeyManagementServiceClient(KeyManagementServiceStub stub) { this.stub = stub; } + @Nullable public final KeyManagementServiceSettings getSettings() { return settings; } @@ -709,9 +711,7 @@ public KeyManagementServiceStub getStub() { */ public final ListKeyRingsPagedResponse listKeyRings(LocationName parent) { ListKeyRingsRequest request = - ListKeyRingsRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .build(); + ListKeyRingsRequest.newBuilder().setParent(parent.toString()).build(); return listKeyRings(request); } @@ -885,9 +885,7 @@ public final UnaryCallable listKeyRin */ public final ListCryptoKeysPagedResponse listCryptoKeys(KeyRingName parent) { ListCryptoKeysRequest request = - ListCryptoKeysRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .build(); + ListCryptoKeysRequest.newBuilder().setParent(parent.toString()).build(); return listCryptoKeys(request); } @@ -1064,9 +1062,7 @@ public final ListCryptoKeysPagedResponse listCryptoKeys(ListCryptoKeysRequest re */ public final ListCryptoKeyVersionsPagedResponse listCryptoKeyVersions(CryptoKeyName parent) { ListCryptoKeyVersionsRequest request = - ListCryptoKeyVersionsRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .build(); + ListCryptoKeyVersionsRequest.newBuilder().setParent(parent.toString()).build(); return listCryptoKeyVersions(request); } @@ -1252,9 +1248,7 @@ public final ListCryptoKeyVersionsPagedResponse listCryptoKeyVersions( */ public final ListImportJobsPagedResponse listImportJobs(KeyRingName parent) { ListImportJobsRequest request = - ListImportJobsRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .build(); + ListImportJobsRequest.newBuilder().setParent(parent.toString()).build(); return listImportJobs(request); } @@ -1426,8 +1420,7 @@ public final ListImportJobsPagedResponse listImportJobs(ListImportJobsRequest re * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final KeyRing getKeyRing(KeyRingName name) { - GetKeyRingRequest request = - GetKeyRingRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + GetKeyRingRequest request = GetKeyRingRequest.newBuilder().setName(name.toString()).build(); return getKeyRing(request); } @@ -1544,8 +1537,7 @@ public final UnaryCallable getKeyRingCallable() { * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final CryptoKey getCryptoKey(CryptoKeyName name) { - GetCryptoKeyRequest request = - GetCryptoKeyRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + GetCryptoKeyRequest request = GetCryptoKeyRequest.newBuilder().setName(name.toString()).build(); return getCryptoKey(request); } @@ -1673,9 +1665,7 @@ public final UnaryCallable getCryptoKeyCallable( */ public final CryptoKeyVersion getCryptoKeyVersion(CryptoKeyVersionName name) { GetCryptoKeyVersionRequest request = - GetCryptoKeyVersionRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .build(); + GetCryptoKeyVersionRequest.newBuilder().setName(name.toString()).build(); return getCryptoKeyVersion(request); } @@ -1813,8 +1803,7 @@ public final CryptoKeyVersion getCryptoKeyVersion(GetCryptoKeyVersionRequest req * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final PublicKey getPublicKey(CryptoKeyVersionName name) { - GetPublicKeyRequest request = - GetPublicKeyRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + GetPublicKeyRequest request = GetPublicKeyRequest.newBuilder().setName(name.toString()).build(); return getPublicKey(request); } @@ -1955,8 +1944,7 @@ public final UnaryCallable getPublicKeyCallable( * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ImportJob getImportJob(ImportJobName name) { - GetImportJobRequest request = - GetImportJobRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + GetImportJobRequest request = GetImportJobRequest.newBuilder().setName(name.toString()).build(); return getImportJob(request); } @@ -2082,7 +2070,7 @@ public final UnaryCallable getImportJobCallable( public final KeyRing createKeyRing(LocationName parent, String keyRingId, KeyRing keyRing) { CreateKeyRingRequest request = CreateKeyRingRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) + .setParent(parent.toString()) .setKeyRingId(keyRingId) .setKeyRing(keyRing) .build(); @@ -2228,7 +2216,7 @@ public final CryptoKey createCryptoKey( KeyRingName parent, String cryptoKeyId, CryptoKey cryptoKey) { CreateCryptoKeyRequest request = CreateCryptoKeyRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) + .setParent(parent.toString()) .setCryptoKeyId(cryptoKeyId) .setCryptoKey(cryptoKey) .build(); @@ -2392,7 +2380,7 @@ public final CryptoKeyVersion createCryptoKeyVersion( CryptoKeyName parent, CryptoKeyVersion cryptoKeyVersion) { CreateCryptoKeyVersionRequest request = CreateCryptoKeyVersionRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) + .setParent(parent.toString()) .setCryptoKeyVersion(cryptoKeyVersion) .build(); return createCryptoKeyVersion(request); @@ -2630,7 +2618,7 @@ public final ImportJob createImportJob( KeyRingName parent, String importJobId, ImportJob importJob) { CreateImportJobRequest request = CreateImportJobRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) + .setParent(parent.toString()) .setImportJobId(importJobId) .setImportJob(importJob) .build(); @@ -3001,10 +2989,7 @@ public final CryptoKeyVersion updateCryptoKeyVersion(UpdateCryptoKeyVersionReque */ public final EncryptResponse encrypt(ResourceName name, ByteString plaintext) { EncryptRequest request = - EncryptRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .setPlaintext(plaintext) - .build(); + EncryptRequest.newBuilder().setName(name.toString()).setPlaintext(plaintext).build(); return encrypt(request); } @@ -3159,10 +3144,7 @@ public final UnaryCallable encryptCallable() { */ public final DecryptResponse decrypt(CryptoKeyName name, ByteString ciphertext) { DecryptRequest request = - DecryptRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .setCiphertext(ciphertext) - .build(); + DecryptRequest.newBuilder().setName(name.toString()).setCiphertext(ciphertext).build(); return decrypt(request); } @@ -3312,10 +3294,7 @@ public final UnaryCallable decryptCallable() { */ public final AsymmetricSignResponse asymmetricSign(CryptoKeyVersionName name, Digest digest) { AsymmetricSignRequest request = - AsymmetricSignRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .setDigest(digest) - .build(); + AsymmetricSignRequest.newBuilder().setName(name.toString()).setDigest(digest).build(); return asymmetricSign(request); } @@ -3477,7 +3456,7 @@ public final AsymmetricDecryptResponse asymmetricDecrypt( CryptoKeyVersionName name, ByteString ciphertext) { AsymmetricDecryptRequest request = AsymmetricDecryptRequest.newBuilder() - .setName(name == null ? null : name.toString()) + .setName(name.toString()) .setCiphertext(ciphertext) .build(); return asymmetricDecrypt(request); @@ -3640,7 +3619,7 @@ public final CryptoKey updateCryptoKeyPrimaryVersion( CryptoKeyName name, String cryptoKeyVersionId) { UpdateCryptoKeyPrimaryVersionRequest request = UpdateCryptoKeyPrimaryVersionRequest.newBuilder() - .setName(name == null ? null : name.toString()) + .setName(name.toString()) .setCryptoKeyVersionId(cryptoKeyVersionId) .build(); return updateCryptoKeyPrimaryVersion(request); @@ -3798,9 +3777,7 @@ public final CryptoKey updateCryptoKeyPrimaryVersion( */ public final CryptoKeyVersion destroyCryptoKeyVersion(CryptoKeyVersionName name) { DestroyCryptoKeyVersionRequest request = - DestroyCryptoKeyVersionRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .build(); + DestroyCryptoKeyVersionRequest.newBuilder().setName(name.toString()).build(); return destroyCryptoKeyVersion(request); } @@ -3982,9 +3959,7 @@ public final CryptoKeyVersion destroyCryptoKeyVersion(DestroyCryptoKeyVersionReq */ public final CryptoKeyVersion restoreCryptoKeyVersion(CryptoKeyVersionName name) { RestoreCryptoKeyVersionRequest request = - RestoreCryptoKeyVersionRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .build(); + RestoreCryptoKeyVersionRequest.newBuilder().setName(name.toString()).build(); return restoreCryptoKeyVersion(request); } @@ -4467,8 +4442,8 @@ public static class ListKeyRingsPage extends AbstractPage { private ListKeyRingsPage( - PageContext context, - ListKeyRingsResponse response) { + @Nullable PageContext context, + @Nullable ListKeyRingsResponse response) { super(context, response); } @@ -4478,14 +4453,14 @@ private static ListKeyRingsPage createEmptyPage() { @Override protected ListKeyRingsPage createPage( - PageContext context, - ListKeyRingsResponse response) { + @Nullable PageContext context, + @Nullable ListKeyRingsResponse response) { return new ListKeyRingsPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + @Nullable PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } @@ -4499,7 +4474,8 @@ public static class ListKeyRingsFixedSizeCollection ListKeyRingsPage, ListKeyRingsFixedSizeCollection> { - private ListKeyRingsFixedSizeCollection(List pages, int collectionSize) { + private ListKeyRingsFixedSizeCollection( + @Nullable List pages, int collectionSize) { super(pages, collectionSize); } @@ -4509,7 +4485,7 @@ private static ListKeyRingsFixedSizeCollection createEmptyCollection() { @Override protected ListKeyRingsFixedSizeCollection createCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { return new ListKeyRingsFixedSizeCollection(pages, collectionSize); } } @@ -4543,8 +4519,8 @@ public static class ListCryptoKeysPage ListCryptoKeysRequest, ListCryptoKeysResponse, CryptoKey, ListCryptoKeysPage> { private ListCryptoKeysPage( - PageContext context, - ListCryptoKeysResponse response) { + @Nullable PageContext context, + @Nullable ListCryptoKeysResponse response) { super(context, response); } @@ -4554,14 +4530,14 @@ private static ListCryptoKeysPage createEmptyPage() { @Override protected ListCryptoKeysPage createPage( - PageContext context, - ListCryptoKeysResponse response) { + @Nullable PageContext context, + @Nullable ListCryptoKeysResponse response) { return new ListCryptoKeysPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + @Nullable PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } @@ -4575,7 +4551,8 @@ public static class ListCryptoKeysFixedSizeCollection ListCryptoKeysPage, ListCryptoKeysFixedSizeCollection> { - private ListCryptoKeysFixedSizeCollection(List pages, int collectionSize) { + private ListCryptoKeysFixedSizeCollection( + @Nullable List pages, int collectionSize) { super(pages, collectionSize); } @@ -4585,7 +4562,7 @@ private static ListCryptoKeysFixedSizeCollection createEmptyCollection() { @Override protected ListCryptoKeysFixedSizeCollection createCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { return new ListCryptoKeysFixedSizeCollection(pages, collectionSize); } } @@ -4623,9 +4600,11 @@ public static class ListCryptoKeyVersionsPage ListCryptoKeyVersionsPage> { private ListCryptoKeyVersionsPage( - PageContext - context, - ListCryptoKeyVersionsResponse response) { + @Nullable + PageContext< + ListCryptoKeyVersionsRequest, ListCryptoKeyVersionsResponse, CryptoKeyVersion> + context, + @Nullable ListCryptoKeyVersionsResponse response) { super(context, response); } @@ -4635,16 +4614,20 @@ private static ListCryptoKeyVersionsPage createEmptyPage() { @Override protected ListCryptoKeyVersionsPage createPage( - PageContext - context, - ListCryptoKeyVersionsResponse response) { + @Nullable + PageContext< + ListCryptoKeyVersionsRequest, ListCryptoKeyVersionsResponse, CryptoKeyVersion> + context, + @Nullable ListCryptoKeyVersionsResponse response) { return new ListCryptoKeyVersionsPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext - context, + @Nullable + PageContext< + ListCryptoKeyVersionsRequest, ListCryptoKeyVersionsResponse, CryptoKeyVersion> + context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } @@ -4659,7 +4642,7 @@ public static class ListCryptoKeyVersionsFixedSizeCollection ListCryptoKeyVersionsFixedSizeCollection> { private ListCryptoKeyVersionsFixedSizeCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { super(pages, collectionSize); } @@ -4669,7 +4652,7 @@ private static ListCryptoKeyVersionsFixedSizeCollection createEmptyCollection() @Override protected ListCryptoKeyVersionsFixedSizeCollection createCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { return new ListCryptoKeyVersionsFixedSizeCollection(pages, collectionSize); } } @@ -4703,8 +4686,8 @@ public static class ListImportJobsPage ListImportJobsRequest, ListImportJobsResponse, ImportJob, ListImportJobsPage> { private ListImportJobsPage( - PageContext context, - ListImportJobsResponse response) { + @Nullable PageContext context, + @Nullable ListImportJobsResponse response) { super(context, response); } @@ -4714,14 +4697,14 @@ private static ListImportJobsPage createEmptyPage() { @Override protected ListImportJobsPage createPage( - PageContext context, - ListImportJobsResponse response) { + @Nullable PageContext context, + @Nullable ListImportJobsResponse response) { return new ListImportJobsPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + @Nullable PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } @@ -4735,7 +4718,8 @@ public static class ListImportJobsFixedSizeCollection ListImportJobsPage, ListImportJobsFixedSizeCollection> { - private ListImportJobsFixedSizeCollection(List pages, int collectionSize) { + private ListImportJobsFixedSizeCollection( + @Nullable List pages, int collectionSize) { super(pages, collectionSize); } @@ -4745,7 +4729,7 @@ private static ListImportJobsFixedSizeCollection createEmptyCollection() { @Override protected ListImportJobsFixedSizeCollection createCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { return new ListImportJobsFixedSizeCollection(pages, collectionSize); } } @@ -4779,8 +4763,8 @@ public static class ListLocationsPage ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { private ListLocationsPage( - PageContext context, - ListLocationsResponse response) { + @Nullable PageContext context, + @Nullable ListLocationsResponse response) { super(context, response); } @@ -4790,14 +4774,14 @@ private static ListLocationsPage createEmptyPage() { @Override protected ListLocationsPage createPage( - PageContext context, - ListLocationsResponse response) { + @Nullable PageContext context, + @Nullable ListLocationsResponse response) { return new ListLocationsPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + @Nullable PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } @@ -4811,7 +4795,8 @@ public static class ListLocationsFixedSizeCollection ListLocationsPage, ListLocationsFixedSizeCollection> { - private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + private ListLocationsFixedSizeCollection( + @Nullable List pages, int collectionSize) { super(pages, collectionSize); } @@ -4821,7 +4806,7 @@ private static ListLocationsFixedSizeCollection createEmptyCollection() { @Override protected ListLocationsFixedSizeCollection createCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { return new ListLocationsFixedSizeCollection(pages, collectionSize); } } diff --git a/sdk-platform-java/test/integration/goldens/kms/src/com/google/cloud/kms/v1/KeyManagementServiceSettings.java b/sdk-platform-java/test/integration/goldens/kms/src/com/google/cloud/kms/v1/KeyManagementServiceSettings.java index 61f4951cdc4c..69e80cefeccb 100644 --- a/sdk-platform-java/test/integration/goldens/kms/src/com/google/cloud/kms/v1/KeyManagementServiceSettings.java +++ b/sdk-platform-java/test/integration/goldens/kms/src/com/google/cloud/kms/v1/KeyManagementServiceSettings.java @@ -46,6 +46,7 @@ import java.util.List; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -301,7 +302,7 @@ public static Builder newBuilder() { } /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { + public static Builder newBuilder(@Nullable ClientContext clientContext) { return new Builder(clientContext); } @@ -322,7 +323,7 @@ protected Builder() throws IOException { this(((ClientContext) null)); } - protected Builder(ClientContext clientContext) { + protected Builder(@Nullable ClientContext clientContext) { super(KeyManagementServiceStubSettings.newBuilder(clientContext)); } diff --git a/sdk-platform-java/test/integration/goldens/kms/src/com/google/cloud/kms/v1/KeyRingName.java b/sdk-platform-java/test/integration/goldens/kms/src/com/google/cloud/kms/v1/KeyRingName.java index b2faeab39438..e9679eacde0d 100644 --- a/sdk-platform-java/test/integration/goldens/kms/src/com/google/cloud/kms/v1/KeyRingName.java +++ b/sdk-platform-java/test/integration/goldens/kms/src/com/google/cloud/kms/v1/KeyRingName.java @@ -26,6 +26,7 @@ import java.util.Objects; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. @NullMarked @@ -85,6 +86,7 @@ public static String format(String project, String location, String keyRing) { .toString(); } + @Nullable public static KeyRingName parse(String formattedString) { if (formattedString.isEmpty()) { return null; @@ -103,7 +105,7 @@ public static List parseList(List formattedStrings) { return list; } - public static List toStringList(List values) { + public static List toStringList(List<@Nullable KeyRingName> values) { List list = new ArrayList<>(values.size()); for (KeyRingName value : values) { if (value == null) { @@ -152,7 +154,7 @@ public String toString() { } @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (o == this) { return true; } diff --git a/sdk-platform-java/test/integration/goldens/kms/src/com/google/cloud/kms/v1/LocationName.java b/sdk-platform-java/test/integration/goldens/kms/src/com/google/cloud/kms/v1/LocationName.java index 8d115370779b..dff995261ded 100644 --- a/sdk-platform-java/test/integration/goldens/kms/src/com/google/cloud/kms/v1/LocationName.java +++ b/sdk-platform-java/test/integration/goldens/kms/src/com/google/cloud/kms/v1/LocationName.java @@ -26,6 +26,7 @@ import java.util.Objects; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. @NullMarked @@ -72,6 +73,7 @@ public static String format(String project, String location) { return newBuilder().setProject(project).setLocation(location).build().toString(); } + @Nullable public static LocationName parse(String formattedString) { if (formattedString.isEmpty()) { return null; @@ -90,7 +92,7 @@ public static List parseList(List formattedStrings) { return list; } - public static List toStringList(List values) { + public static List toStringList(List<@Nullable LocationName> values) { List list = new ArrayList<>(values.size()); for (LocationName value : values) { if (value == null) { @@ -135,7 +137,7 @@ public String toString() { } @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (o == this) { return true; } diff --git a/sdk-platform-java/test/integration/goldens/kms/src/com/google/cloud/kms/v1/stub/KeyManagementServiceStubSettings.java b/sdk-platform-java/test/integration/goldens/kms/src/com/google/cloud/kms/v1/stub/KeyManagementServiceStubSettings.java index b2398a668d42..da456c09f521 100644 --- a/sdk-platform-java/test/integration/goldens/kms/src/com/google/cloud/kms/v1/stub/KeyManagementServiceStubSettings.java +++ b/sdk-platform-java/test/integration/goldens/kms/src/com/google/cloud/kms/v1/stub/KeyManagementServiceStubSettings.java @@ -98,6 +98,7 @@ import java.util.List; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -704,7 +705,7 @@ public static Builder newBuilder() { } /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { + public static Builder newBuilder(@Nullable ClientContext clientContext) { return new Builder(clientContext); } @@ -857,7 +858,7 @@ protected Builder() { this(((ClientContext) null)); } - protected Builder(ClientContext clientContext) { + protected Builder(@Nullable ClientContext clientContext) { super(clientContext); listKeyRingsSettings = PagedCallSettings.newBuilder(LIST_KEY_RINGS_PAGE_STR_FACT); diff --git a/sdk-platform-java/test/integration/goldens/library/src/com/google/cloud/example/library/v1/LibraryServiceClient.java b/sdk-platform-java/test/integration/goldens/library/src/com/google/cloud/example/library/v1/LibraryServiceClient.java index 7146943da73b..c4da20cbd333 100644 --- a/sdk-platform-java/test/integration/goldens/library/src/com/google/cloud/example/library/v1/LibraryServiceClient.java +++ b/sdk-platform-java/test/integration/goldens/library/src/com/google/cloud/example/library/v1/LibraryServiceClient.java @@ -51,6 +51,7 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -355,7 +356,7 @@ @NullMarked @Generated("by gapic-generator-java") public class LibraryServiceClient implements BackgroundResource { - private final LibraryServiceSettings settings; + @Nullable private final LibraryServiceSettings settings; private final LibraryServiceStub stub; /** Constructs an instance of LibraryServiceClient with default settings. */ @@ -395,6 +396,7 @@ protected LibraryServiceClient(LibraryServiceStub stub) { this.stub = stub; } + @Nullable public final LibraryServiceSettings getSettings() { return settings; } @@ -502,8 +504,7 @@ public final UnaryCallable createShelfCallable() { * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Shelf getShelf(ShelfName name) { - GetShelfRequest request = - GetShelfRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + GetShelfRequest request = GetShelfRequest.newBuilder().setName(name.toString()).build(); return getShelf(request); } @@ -708,8 +709,7 @@ public final UnaryCallable listShelvesC * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final void deleteShelf(ShelfName name) { - DeleteShelfRequest request = - DeleteShelfRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + DeleteShelfRequest request = DeleteShelfRequest.newBuilder().setName(name.toString()).build(); deleteShelf(request); } @@ -821,8 +821,8 @@ public final UnaryCallable deleteShelfCallable() { public final Shelf mergeShelves(ShelfName name, ShelfName otherShelf) { MergeShelvesRequest request = MergeShelvesRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .setOtherShelf(otherShelf == null ? null : otherShelf.toString()) + .setName(name.toString()) + .setOtherShelf(otherShelf.toString()) .build(); return mergeShelves(request); } @@ -857,10 +857,7 @@ public final Shelf mergeShelves(ShelfName name, ShelfName otherShelf) { */ public final Shelf mergeShelves(ShelfName name, String otherShelf) { MergeShelvesRequest request = - MergeShelvesRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .setOtherShelf(otherShelf) - .build(); + MergeShelvesRequest.newBuilder().setName(name.toString()).setOtherShelf(otherShelf).build(); return mergeShelves(request); } @@ -894,10 +891,7 @@ public final Shelf mergeShelves(ShelfName name, String otherShelf) { */ public final Shelf mergeShelves(String name, ShelfName otherShelf) { MergeShelvesRequest request = - MergeShelvesRequest.newBuilder() - .setName(name) - .setOtherShelf(otherShelf == null ? null : otherShelf.toString()) - .build(); + MergeShelvesRequest.newBuilder().setName(name).setOtherShelf(otherShelf.toString()).build(); return mergeShelves(request); } @@ -1027,10 +1021,7 @@ public final UnaryCallable mergeShelvesCallable() { */ public final Book createBook(ShelfName parent, Book book) { CreateBookRequest request = - CreateBookRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .setBook(book) - .build(); + CreateBookRequest.newBuilder().setParent(parent.toString()).setBook(book).build(); return createBook(request); } @@ -1142,8 +1133,7 @@ public final UnaryCallable createBookCallable() { * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Book getBook(BookName name) { - GetBookRequest request = - GetBookRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + GetBookRequest request = GetBookRequest.newBuilder().setName(name.toString()).build(); return getBook(request); } @@ -1250,8 +1240,7 @@ public final UnaryCallable getBookCallable() { * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListBooksPagedResponse listBooks(ShelfName parent) { - ListBooksRequest request = - ListBooksRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + ListBooksRequest request = ListBooksRequest.newBuilder().setParent(parent.toString()).build(); return listBooks(request); } @@ -1414,8 +1403,7 @@ public final UnaryCallable listBooksCallabl * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final void deleteBook(BookName name) { - DeleteBookRequest request = - DeleteBookRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + DeleteBookRequest request = DeleteBookRequest.newBuilder().setName(name.toString()).build(); deleteBook(request); } @@ -1616,8 +1604,8 @@ public final UnaryCallable updateBookCallable() { public final Book moveBook(BookName name, ShelfName otherShelfName) { MoveBookRequest request = MoveBookRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .setOtherShelfName(otherShelfName == null ? null : otherShelfName.toString()) + .setName(name.toString()) + .setOtherShelfName(otherShelfName.toString()) .build(); return moveBook(request); } @@ -1649,7 +1637,7 @@ public final Book moveBook(BookName name, ShelfName otherShelfName) { public final Book moveBook(BookName name, String otherShelfName) { MoveBookRequest request = MoveBookRequest.newBuilder() - .setName(name == null ? null : name.toString()) + .setName(name.toString()) .setOtherShelfName(otherShelfName) .build(); return moveBook(request); @@ -1683,7 +1671,7 @@ public final Book moveBook(String name, ShelfName otherShelfName) { MoveBookRequest request = MoveBookRequest.newBuilder() .setName(name) - .setOtherShelfName(otherShelfName == null ? null : otherShelfName.toString()) + .setOtherShelfName(otherShelfName.toString()) .build(); return moveBook(request); } @@ -1833,8 +1821,8 @@ public static class ListShelvesPage extends AbstractPage { private ListShelvesPage( - PageContext context, - ListShelvesResponse response) { + @Nullable PageContext context, + @Nullable ListShelvesResponse response) { super(context, response); } @@ -1844,14 +1832,14 @@ private static ListShelvesPage createEmptyPage() { @Override protected ListShelvesPage createPage( - PageContext context, - ListShelvesResponse response) { + @Nullable PageContext context, + @Nullable ListShelvesResponse response) { return new ListShelvesPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + @Nullable PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } @@ -1865,7 +1853,8 @@ public static class ListShelvesFixedSizeCollection ListShelvesPage, ListShelvesFixedSizeCollection> { - private ListShelvesFixedSizeCollection(List pages, int collectionSize) { + private ListShelvesFixedSizeCollection( + @Nullable List pages, int collectionSize) { super(pages, collectionSize); } @@ -1875,7 +1864,7 @@ private static ListShelvesFixedSizeCollection createEmptyCollection() { @Override protected ListShelvesFixedSizeCollection createCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { return new ListShelvesFixedSizeCollection(pages, collectionSize); } } @@ -1902,8 +1891,8 @@ public static class ListBooksPage extends AbstractPage { private ListBooksPage( - PageContext context, - ListBooksResponse response) { + @Nullable PageContext context, + @Nullable ListBooksResponse response) { super(context, response); } @@ -1913,14 +1902,14 @@ private static ListBooksPage createEmptyPage() { @Override protected ListBooksPage createPage( - PageContext context, - ListBooksResponse response) { + @Nullable PageContext context, + @Nullable ListBooksResponse response) { return new ListBooksPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + @Nullable PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } @@ -1930,7 +1919,7 @@ public static class ListBooksFixedSizeCollection extends AbstractFixedSizeCollection< ListBooksRequest, ListBooksResponse, Book, ListBooksPage, ListBooksFixedSizeCollection> { - private ListBooksFixedSizeCollection(List pages, int collectionSize) { + private ListBooksFixedSizeCollection(@Nullable List pages, int collectionSize) { super(pages, collectionSize); } @@ -1940,7 +1929,7 @@ private static ListBooksFixedSizeCollection createEmptyCollection() { @Override protected ListBooksFixedSizeCollection createCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { return new ListBooksFixedSizeCollection(pages, collectionSize); } } diff --git a/sdk-platform-java/test/integration/goldens/library/src/com/google/cloud/example/library/v1/LibraryServiceSettings.java b/sdk-platform-java/test/integration/goldens/library/src/com/google/cloud/example/library/v1/LibraryServiceSettings.java index 2bd7ba039c9c..011051ce6b1d 100644 --- a/sdk-platform-java/test/integration/goldens/library/src/com/google/cloud/example/library/v1/LibraryServiceSettings.java +++ b/sdk-platform-java/test/integration/goldens/library/src/com/google/cloud/example/library/v1/LibraryServiceSettings.java @@ -53,6 +53,7 @@ import java.util.List; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -222,7 +223,7 @@ public static Builder newHttpJsonBuilder() { } /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { + public static Builder newBuilder(@Nullable ClientContext clientContext) { return new Builder(clientContext); } @@ -242,7 +243,7 @@ protected Builder() throws IOException { this(((ClientContext) null)); } - protected Builder(ClientContext clientContext) { + protected Builder(@Nullable ClientContext clientContext) { super(LibraryServiceStubSettings.newBuilder(clientContext)); } diff --git a/sdk-platform-java/test/integration/goldens/library/src/com/google/cloud/example/library/v1/stub/LibraryServiceStubSettings.java b/sdk-platform-java/test/integration/goldens/library/src/com/google/cloud/example/library/v1/stub/LibraryServiceStubSettings.java index 8e74f9c6e25d..cf39d5f4ffda 100644 --- a/sdk-platform-java/test/integration/goldens/library/src/com/google/cloud/example/library/v1/stub/LibraryServiceStubSettings.java +++ b/sdk-platform-java/test/integration/goldens/library/src/com/google/cloud/example/library/v1/stub/LibraryServiceStubSettings.java @@ -71,6 +71,7 @@ import java.util.List; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -403,7 +404,7 @@ public static Builder newHttpJsonBuilder() { } /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { + public static Builder newBuilder(@Nullable ClientContext clientContext) { return new Builder(clientContext); } @@ -501,7 +502,7 @@ protected Builder() { this(((ClientContext) null)); } - protected Builder(ClientContext clientContext) { + protected Builder(@Nullable ClientContext clientContext) { super(clientContext); createShelfSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); diff --git a/sdk-platform-java/test/integration/goldens/library/src/com/google/example/library/v1/BookName.java b/sdk-platform-java/test/integration/goldens/library/src/com/google/example/library/v1/BookName.java index a115d587e51d..fcc72db032b3 100644 --- a/sdk-platform-java/test/integration/goldens/library/src/com/google/example/library/v1/BookName.java +++ b/sdk-platform-java/test/integration/goldens/library/src/com/google/example/library/v1/BookName.java @@ -26,6 +26,7 @@ import java.util.Objects; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. @NullMarked @@ -72,6 +73,7 @@ public static String format(String shelf, String book) { return newBuilder().setShelf(shelf).setBook(book).build().toString(); } + @Nullable public static BookName parse(String formattedString) { if (formattedString.isEmpty()) { return null; @@ -90,7 +92,7 @@ public static List parseList(List formattedStrings) { return list; } - public static List toStringList(List values) { + public static List toStringList(List<@Nullable BookName> values) { List list = new ArrayList<>(values.size()); for (BookName value : values) { if (value == null) { @@ -135,7 +137,7 @@ public String toString() { } @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (o == this) { return true; } diff --git a/sdk-platform-java/test/integration/goldens/library/src/com/google/example/library/v1/ShelfName.java b/sdk-platform-java/test/integration/goldens/library/src/com/google/example/library/v1/ShelfName.java index 172ce6f1d71c..73cb3a6ac6db 100644 --- a/sdk-platform-java/test/integration/goldens/library/src/com/google/example/library/v1/ShelfName.java +++ b/sdk-platform-java/test/integration/goldens/library/src/com/google/example/library/v1/ShelfName.java @@ -26,6 +26,7 @@ import java.util.Objects; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. @NullMarked @@ -65,6 +66,7 @@ public static String format(String shelfId) { return newBuilder().setShelfId(shelfId).build().toString(); } + @Nullable public static ShelfName parse(String formattedString) { if (formattedString.isEmpty()) { return null; @@ -83,7 +85,7 @@ public static List parseList(List formattedStrings) { return list; } - public static List toStringList(List values) { + public static List toStringList(List<@Nullable ShelfName> values) { List list = new ArrayList<>(values.size()); for (ShelfName value : values) { if (value == null) { @@ -125,7 +127,7 @@ public String toString() { } @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (o == this) { return true; } diff --git a/sdk-platform-java/test/integration/goldens/logging/src/com/google/cloud/logging/v2/ConfigClient.java b/sdk-platform-java/test/integration/goldens/logging/src/com/google/cloud/logging/v2/ConfigClient.java index 3b949565cc9e..321b51669e8f 100644 --- a/sdk-platform-java/test/integration/goldens/logging/src/com/google/cloud/logging/v2/ConfigClient.java +++ b/sdk-platform-java/test/integration/goldens/logging/src/com/google/cloud/logging/v2/ConfigClient.java @@ -87,6 +87,7 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -634,7 +635,7 @@ @NullMarked @Generated("by gapic-generator-java") public class ConfigClient implements BackgroundResource { - private final ConfigSettings settings; + @Nullable private final ConfigSettings settings; private final ConfigServiceV2Stub stub; private final OperationsClient operationsClient; @@ -675,6 +676,7 @@ protected ConfigClient(ConfigServiceV2Stub stub) { this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); } + @Nullable public final ConfigSettings getSettings() { return settings; } @@ -723,9 +725,7 @@ public final OperationsClient getOperationsClient() { */ public final ListBucketsPagedResponse listBuckets(BillingAccountLocationName parent) { ListBucketsRequest request = - ListBucketsRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .build(); + ListBucketsRequest.newBuilder().setParent(parent.toString()).build(); return listBuckets(request); } @@ -760,9 +760,7 @@ public final ListBucketsPagedResponse listBuckets(BillingAccountLocationName par */ public final ListBucketsPagedResponse listBuckets(FolderLocationName parent) { ListBucketsRequest request = - ListBucketsRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .build(); + ListBucketsRequest.newBuilder().setParent(parent.toString()).build(); return listBuckets(request); } @@ -797,9 +795,7 @@ public final ListBucketsPagedResponse listBuckets(FolderLocationName parent) { */ public final ListBucketsPagedResponse listBuckets(LocationName parent) { ListBucketsRequest request = - ListBucketsRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .build(); + ListBucketsRequest.newBuilder().setParent(parent.toString()).build(); return listBuckets(request); } @@ -834,9 +830,7 @@ public final ListBucketsPagedResponse listBuckets(LocationName parent) { */ public final ListBucketsPagedResponse listBuckets(OrganizationLocationName parent) { ListBucketsRequest request = - ListBucketsRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .build(); + ListBucketsRequest.newBuilder().setParent(parent.toString()).build(); return listBuckets(request); } @@ -1709,8 +1703,7 @@ public final UnaryCallable deleteViewCallable() { * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListSinksPagedResponse listSinks(BillingAccountName parent) { - ListSinksRequest request = - ListSinksRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + ListSinksRequest request = ListSinksRequest.newBuilder().setParent(parent.toString()).build(); return listSinks(request); } @@ -1740,8 +1733,7 @@ public final ListSinksPagedResponse listSinks(BillingAccountName parent) { * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListSinksPagedResponse listSinks(FolderName parent) { - ListSinksRequest request = - ListSinksRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + ListSinksRequest request = ListSinksRequest.newBuilder().setParent(parent.toString()).build(); return listSinks(request); } @@ -1771,8 +1763,7 @@ public final ListSinksPagedResponse listSinks(FolderName parent) { * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListSinksPagedResponse listSinks(OrganizationName parent) { - ListSinksRequest request = - ListSinksRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + ListSinksRequest request = ListSinksRequest.newBuilder().setParent(parent.toString()).build(); return listSinks(request); } @@ -1802,8 +1793,7 @@ public final ListSinksPagedResponse listSinks(OrganizationName parent) { * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListSinksPagedResponse listSinks(ProjectName parent) { - ListSinksRequest request = - ListSinksRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + ListSinksRequest request = ListSinksRequest.newBuilder().setParent(parent.toString()).build(); return listSinks(request); } @@ -1966,10 +1956,7 @@ public final UnaryCallable listSinksCallabl * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final LogSink getSink(LogSinkName sinkName) { - GetSinkRequest request = - GetSinkRequest.newBuilder() - .setSinkName(sinkName == null ? null : sinkName.toString()) - .build(); + GetSinkRequest request = GetSinkRequest.newBuilder().setSinkName(sinkName.toString()).build(); return getSink(request); } @@ -2093,10 +2080,7 @@ public final UnaryCallable getSinkCallable() { */ public final LogSink createSink(BillingAccountName parent, LogSink sink) { CreateSinkRequest request = - CreateSinkRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .setSink(sink) - .build(); + CreateSinkRequest.newBuilder().setParent(parent.toString()).setSink(sink).build(); return createSink(request); } @@ -2133,10 +2117,7 @@ public final LogSink createSink(BillingAccountName parent, LogSink sink) { */ public final LogSink createSink(FolderName parent, LogSink sink) { CreateSinkRequest request = - CreateSinkRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .setSink(sink) - .build(); + CreateSinkRequest.newBuilder().setParent(parent.toString()).setSink(sink).build(); return createSink(request); } @@ -2173,10 +2154,7 @@ public final LogSink createSink(FolderName parent, LogSink sink) { */ public final LogSink createSink(OrganizationName parent, LogSink sink) { CreateSinkRequest request = - CreateSinkRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .setSink(sink) - .build(); + CreateSinkRequest.newBuilder().setParent(parent.toString()).setSink(sink).build(); return createSink(request); } @@ -2213,10 +2191,7 @@ public final LogSink createSink(OrganizationName parent, LogSink sink) { */ public final LogSink createSink(ProjectName parent, LogSink sink) { CreateSinkRequest request = - CreateSinkRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .setSink(sink) - .build(); + CreateSinkRequest.newBuilder().setParent(parent.toString()).setSink(sink).build(); return createSink(request); } @@ -2359,10 +2334,7 @@ public final UnaryCallable createSinkCallable() { */ public final LogSink updateSink(LogSinkName sinkName, LogSink sink) { UpdateSinkRequest request = - UpdateSinkRequest.newBuilder() - .setSinkName(sinkName == null ? null : sinkName.toString()) - .setSink(sink) - .build(); + UpdateSinkRequest.newBuilder().setSinkName(sinkName.toString()).setSink(sink).build(); return updateSink(request); } @@ -2457,7 +2429,7 @@ public final LogSink updateSink(String sinkName, LogSink sink) { public final LogSink updateSink(LogSinkName sinkName, LogSink sink, FieldMask updateMask) { UpdateSinkRequest request = UpdateSinkRequest.newBuilder() - .setSinkName(sinkName == null ? null : sinkName.toString()) + .setSinkName(sinkName.toString()) .setSink(sink) .setUpdateMask(updateMask) .build(); @@ -2621,9 +2593,7 @@ public final UnaryCallable updateSinkCallable() { */ public final void deleteSink(LogSinkName sinkName) { DeleteSinkRequest request = - DeleteSinkRequest.newBuilder() - .setSinkName(sinkName == null ? null : sinkName.toString()) - .build(); + DeleteSinkRequest.newBuilder().setSinkName(sinkName.toString()).build(); deleteSink(request); } @@ -2745,9 +2715,7 @@ public final UnaryCallable deleteSinkCallable() { */ public final ListExclusionsPagedResponse listExclusions(BillingAccountName parent) { ListExclusionsRequest request = - ListExclusionsRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .build(); + ListExclusionsRequest.newBuilder().setParent(parent.toString()).build(); return listExclusions(request); } @@ -2778,9 +2746,7 @@ public final ListExclusionsPagedResponse listExclusions(BillingAccountName paren */ public final ListExclusionsPagedResponse listExclusions(FolderName parent) { ListExclusionsRequest request = - ListExclusionsRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .build(); + ListExclusionsRequest.newBuilder().setParent(parent.toString()).build(); return listExclusions(request); } @@ -2811,9 +2777,7 @@ public final ListExclusionsPagedResponse listExclusions(FolderName parent) { */ public final ListExclusionsPagedResponse listExclusions(OrganizationName parent) { ListExclusionsRequest request = - ListExclusionsRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .build(); + ListExclusionsRequest.newBuilder().setParent(parent.toString()).build(); return listExclusions(request); } @@ -2844,9 +2808,7 @@ public final ListExclusionsPagedResponse listExclusions(OrganizationName parent) */ public final ListExclusionsPagedResponse listExclusions(ProjectName parent) { ListExclusionsRequest request = - ListExclusionsRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .build(); + ListExclusionsRequest.newBuilder().setParent(parent.toString()).build(); return listExclusions(request); } @@ -3012,8 +2974,7 @@ public final ListExclusionsPagedResponse listExclusions(ListExclusionsRequest re * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final LogExclusion getExclusion(LogExclusionName name) { - GetExclusionRequest request = - GetExclusionRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + GetExclusionRequest request = GetExclusionRequest.newBuilder().setName(name.toString()).build(); return getExclusion(request); } @@ -3138,7 +3099,7 @@ public final UnaryCallable getExclusionCallab public final LogExclusion createExclusion(BillingAccountName parent, LogExclusion exclusion) { CreateExclusionRequest request = CreateExclusionRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) + .setParent(parent.toString()) .setExclusion(exclusion) .build(); return createExclusion(request); @@ -3176,7 +3137,7 @@ public final LogExclusion createExclusion(BillingAccountName parent, LogExclusio public final LogExclusion createExclusion(FolderName parent, LogExclusion exclusion) { CreateExclusionRequest request = CreateExclusionRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) + .setParent(parent.toString()) .setExclusion(exclusion) .build(); return createExclusion(request); @@ -3214,7 +3175,7 @@ public final LogExclusion createExclusion(FolderName parent, LogExclusion exclus public final LogExclusion createExclusion(OrganizationName parent, LogExclusion exclusion) { CreateExclusionRequest request = CreateExclusionRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) + .setParent(parent.toString()) .setExclusion(exclusion) .build(); return createExclusion(request); @@ -3252,7 +3213,7 @@ public final LogExclusion createExclusion(OrganizationName parent, LogExclusion public final LogExclusion createExclusion(ProjectName parent, LogExclusion exclusion) { CreateExclusionRequest request = CreateExclusionRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) + .setParent(parent.toString()) .setExclusion(exclusion) .build(); return createExclusion(request); @@ -3393,7 +3354,7 @@ public final LogExclusion updateExclusion( LogExclusionName name, LogExclusion exclusion, FieldMask updateMask) { UpdateExclusionRequest request = UpdateExclusionRequest.newBuilder() - .setName(name == null ? null : name.toString()) + .setName(name.toString()) .setExclusion(exclusion) .setUpdateMask(updateMask) .build(); @@ -3538,7 +3499,7 @@ public final UnaryCallable updateExclusion */ public final void deleteExclusion(LogExclusionName name) { DeleteExclusionRequest request = - DeleteExclusionRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + DeleteExclusionRequest.newBuilder().setName(name.toString()).build(); deleteExclusion(request); } @@ -3822,8 +3783,7 @@ public final UnaryCallable updateCmekSe * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Settings getSettings(SettingsName name) { - GetSettingsRequest request = - GetSettingsRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + GetSettingsRequest request = GetSettingsRequest.newBuilder().setName(name.toString()).build(); return getSettings(request); } @@ -4219,8 +4179,8 @@ public static class ListBucketsPage extends AbstractPage { private ListBucketsPage( - PageContext context, - ListBucketsResponse response) { + @Nullable PageContext context, + @Nullable ListBucketsResponse response) { super(context, response); } @@ -4230,14 +4190,14 @@ private static ListBucketsPage createEmptyPage() { @Override protected ListBucketsPage createPage( - PageContext context, - ListBucketsResponse response) { + @Nullable PageContext context, + @Nullable ListBucketsResponse response) { return new ListBucketsPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + @Nullable PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } @@ -4251,7 +4211,8 @@ public static class ListBucketsFixedSizeCollection ListBucketsPage, ListBucketsFixedSizeCollection> { - private ListBucketsFixedSizeCollection(List pages, int collectionSize) { + private ListBucketsFixedSizeCollection( + @Nullable List pages, int collectionSize) { super(pages, collectionSize); } @@ -4261,7 +4222,7 @@ private static ListBucketsFixedSizeCollection createEmptyCollection() { @Override protected ListBucketsFixedSizeCollection createCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { return new ListBucketsFixedSizeCollection(pages, collectionSize); } } @@ -4292,8 +4253,8 @@ public static class ListViewsPage extends AbstractPage { private ListViewsPage( - PageContext context, - ListViewsResponse response) { + @Nullable PageContext context, + @Nullable ListViewsResponse response) { super(context, response); } @@ -4303,14 +4264,14 @@ private static ListViewsPage createEmptyPage() { @Override protected ListViewsPage createPage( - PageContext context, - ListViewsResponse response) { + @Nullable PageContext context, + @Nullable ListViewsResponse response) { return new ListViewsPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + @Nullable PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } @@ -4324,7 +4285,7 @@ public static class ListViewsFixedSizeCollection ListViewsPage, ListViewsFixedSizeCollection> { - private ListViewsFixedSizeCollection(List pages, int collectionSize) { + private ListViewsFixedSizeCollection(@Nullable List pages, int collectionSize) { super(pages, collectionSize); } @@ -4334,7 +4295,7 @@ private static ListViewsFixedSizeCollection createEmptyCollection() { @Override protected ListViewsFixedSizeCollection createCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { return new ListViewsFixedSizeCollection(pages, collectionSize); } } @@ -4365,8 +4326,8 @@ public static class ListSinksPage extends AbstractPage { private ListSinksPage( - PageContext context, - ListSinksResponse response) { + @Nullable PageContext context, + @Nullable ListSinksResponse response) { super(context, response); } @@ -4376,14 +4337,14 @@ private static ListSinksPage createEmptyPage() { @Override protected ListSinksPage createPage( - PageContext context, - ListSinksResponse response) { + @Nullable PageContext context, + @Nullable ListSinksResponse response) { return new ListSinksPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + @Nullable PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } @@ -4397,7 +4358,7 @@ public static class ListSinksFixedSizeCollection ListSinksPage, ListSinksFixedSizeCollection> { - private ListSinksFixedSizeCollection(List pages, int collectionSize) { + private ListSinksFixedSizeCollection(@Nullable List pages, int collectionSize) { super(pages, collectionSize); } @@ -4407,7 +4368,7 @@ private static ListSinksFixedSizeCollection createEmptyCollection() { @Override protected ListSinksFixedSizeCollection createCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { return new ListSinksFixedSizeCollection(pages, collectionSize); } } @@ -4441,8 +4402,8 @@ public static class ListExclusionsPage ListExclusionsRequest, ListExclusionsResponse, LogExclusion, ListExclusionsPage> { private ListExclusionsPage( - PageContext context, - ListExclusionsResponse response) { + @Nullable PageContext context, + @Nullable ListExclusionsResponse response) { super(context, response); } @@ -4452,14 +4413,14 @@ private static ListExclusionsPage createEmptyPage() { @Override protected ListExclusionsPage createPage( - PageContext context, - ListExclusionsResponse response) { + @Nullable PageContext context, + @Nullable ListExclusionsResponse response) { return new ListExclusionsPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + @Nullable PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } @@ -4473,7 +4434,8 @@ public static class ListExclusionsFixedSizeCollection ListExclusionsPage, ListExclusionsFixedSizeCollection> { - private ListExclusionsFixedSizeCollection(List pages, int collectionSize) { + private ListExclusionsFixedSizeCollection( + @Nullable List pages, int collectionSize) { super(pages, collectionSize); } @@ -4483,7 +4445,7 @@ private static ListExclusionsFixedSizeCollection createEmptyCollection() { @Override protected ListExclusionsFixedSizeCollection createCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { return new ListExclusionsFixedSizeCollection(pages, collectionSize); } } diff --git a/sdk-platform-java/test/integration/goldens/logging/src/com/google/cloud/logging/v2/ConfigSettings.java b/sdk-platform-java/test/integration/goldens/logging/src/com/google/cloud/logging/v2/ConfigSettings.java index 2904dc6ec896..67d6a258d21d 100644 --- a/sdk-platform-java/test/integration/goldens/logging/src/com/google/cloud/logging/v2/ConfigSettings.java +++ b/sdk-platform-java/test/integration/goldens/logging/src/com/google/cloud/logging/v2/ConfigSettings.java @@ -78,6 +78,7 @@ import java.util.List; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -342,7 +343,7 @@ public static Builder newBuilder() { } /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { + public static Builder newBuilder(@Nullable ClientContext clientContext) { return new Builder(clientContext); } @@ -362,7 +363,7 @@ protected Builder() throws IOException { this(((ClientContext) null)); } - protected Builder(ClientContext clientContext) { + protected Builder(@Nullable ClientContext clientContext) { super(ConfigServiceV2StubSettings.newBuilder(clientContext)); } diff --git a/sdk-platform-java/test/integration/goldens/logging/src/com/google/cloud/logging/v2/LoggingClient.java b/sdk-platform-java/test/integration/goldens/logging/src/com/google/cloud/logging/v2/LoggingClient.java index 707c661a9e79..3b2aaed13f7e 100644 --- a/sdk-platform-java/test/integration/goldens/logging/src/com/google/cloud/logging/v2/LoggingClient.java +++ b/sdk-platform-java/test/integration/goldens/logging/src/com/google/cloud/logging/v2/LoggingClient.java @@ -54,6 +54,7 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -232,7 +233,7 @@ @NullMarked @Generated("by gapic-generator-java") public class LoggingClient implements BackgroundResource { - private final LoggingSettings settings; + @Nullable private final LoggingSettings settings; private final LoggingServiceV2Stub stub; /** Constructs an instance of LoggingClient with default settings. */ @@ -270,6 +271,7 @@ protected LoggingClient(LoggingServiceV2Stub stub) { this.stub = stub; } + @Nullable public final LoggingSettings getSettings() { return settings; } @@ -312,10 +314,7 @@ public LoggingServiceV2Stub getStub() { * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final void deleteLog(LogName logName) { - DeleteLogRequest request = - DeleteLogRequest.newBuilder() - .setLogName(logName == null ? null : logName.toString()) - .build(); + DeleteLogRequest request = DeleteLogRequest.newBuilder().setLogName(logName.toString()).build(); deleteLog(request); } @@ -488,13 +487,13 @@ public final UnaryCallable deleteLogCallable() { * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final WriteLogEntriesResponse writeLogEntries( - LogName logName, + @Nullable LogName logName, MonitoredResource resource, Map labels, List entries) { WriteLogEntriesRequest request = WriteLogEntriesRequest.newBuilder() - .setLogName(logName == null ? null : logName.toString()) + .setLogName(logName == null ? "" : logName.toString()) .setResource(resource) .putAllLabels(labels) .addAllEntries(entries) @@ -977,8 +976,7 @@ public final ListMonitoredResourceDescriptorsPagedResponse listMonitoredResource * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListLogsPagedResponse listLogs(BillingAccountName parent) { - ListLogsRequest request = - ListLogsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + ListLogsRequest request = ListLogsRequest.newBuilder().setParent(parent.toString()).build(); return listLogs(request); } @@ -1014,8 +1012,7 @@ public final ListLogsPagedResponse listLogs(BillingAccountName parent) { * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListLogsPagedResponse listLogs(FolderName parent) { - ListLogsRequest request = - ListLogsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + ListLogsRequest request = ListLogsRequest.newBuilder().setParent(parent.toString()).build(); return listLogs(request); } @@ -1051,8 +1048,7 @@ public final ListLogsPagedResponse listLogs(FolderName parent) { * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListLogsPagedResponse listLogs(OrganizationName parent) { - ListLogsRequest request = - ListLogsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + ListLogsRequest request = ListLogsRequest.newBuilder().setParent(parent.toString()).build(); return listLogs(request); } @@ -1088,8 +1084,7 @@ public final ListLogsPagedResponse listLogs(OrganizationName parent) { * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListLogsPagedResponse listLogs(ProjectName parent) { - ListLogsRequest request = - ListLogsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + ListLogsRequest request = ListLogsRequest.newBuilder().setParent(parent.toString()).build(); return listLogs(request); } @@ -1329,8 +1324,8 @@ public static class ListLogEntriesPage ListLogEntriesRequest, ListLogEntriesResponse, LogEntry, ListLogEntriesPage> { private ListLogEntriesPage( - PageContext context, - ListLogEntriesResponse response) { + @Nullable PageContext context, + @Nullable ListLogEntriesResponse response) { super(context, response); } @@ -1340,14 +1335,14 @@ private static ListLogEntriesPage createEmptyPage() { @Override protected ListLogEntriesPage createPage( - PageContext context, - ListLogEntriesResponse response) { + @Nullable PageContext context, + @Nullable ListLogEntriesResponse response) { return new ListLogEntriesPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + @Nullable PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } @@ -1361,7 +1356,8 @@ public static class ListLogEntriesFixedSizeCollection ListLogEntriesPage, ListLogEntriesFixedSizeCollection> { - private ListLogEntriesFixedSizeCollection(List pages, int collectionSize) { + private ListLogEntriesFixedSizeCollection( + @Nullable List pages, int collectionSize) { super(pages, collectionSize); } @@ -1371,7 +1367,7 @@ private static ListLogEntriesFixedSizeCollection createEmptyCollection() { @Override protected ListLogEntriesFixedSizeCollection createCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { return new ListLogEntriesFixedSizeCollection(pages, collectionSize); } } @@ -1414,12 +1410,13 @@ public static class ListMonitoredResourceDescriptorsPage ListMonitoredResourceDescriptorsPage> { private ListMonitoredResourceDescriptorsPage( - PageContext< - ListMonitoredResourceDescriptorsRequest, - ListMonitoredResourceDescriptorsResponse, - MonitoredResourceDescriptor> - context, - ListMonitoredResourceDescriptorsResponse response) { + @Nullable + PageContext< + ListMonitoredResourceDescriptorsRequest, + ListMonitoredResourceDescriptorsResponse, + MonitoredResourceDescriptor> + context, + @Nullable ListMonitoredResourceDescriptorsResponse response) { super(context, response); } @@ -1429,22 +1426,24 @@ private static ListMonitoredResourceDescriptorsPage createEmptyPage() { @Override protected ListMonitoredResourceDescriptorsPage createPage( - PageContext< - ListMonitoredResourceDescriptorsRequest, - ListMonitoredResourceDescriptorsResponse, - MonitoredResourceDescriptor> - context, - ListMonitoredResourceDescriptorsResponse response) { + @Nullable + PageContext< + ListMonitoredResourceDescriptorsRequest, + ListMonitoredResourceDescriptorsResponse, + MonitoredResourceDescriptor> + context, + @Nullable ListMonitoredResourceDescriptorsResponse response) { return new ListMonitoredResourceDescriptorsPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext< - ListMonitoredResourceDescriptorsRequest, - ListMonitoredResourceDescriptorsResponse, - MonitoredResourceDescriptor> - context, + @Nullable + PageContext< + ListMonitoredResourceDescriptorsRequest, + ListMonitoredResourceDescriptorsResponse, + MonitoredResourceDescriptor> + context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } @@ -1459,7 +1458,7 @@ public static class ListMonitoredResourceDescriptorsFixedSizeCollection ListMonitoredResourceDescriptorsFixedSizeCollection> { private ListMonitoredResourceDescriptorsFixedSizeCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { super(pages, collectionSize); } @@ -1469,7 +1468,7 @@ private static ListMonitoredResourceDescriptorsFixedSizeCollection createEmptyCo @Override protected ListMonitoredResourceDescriptorsFixedSizeCollection createCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { return new ListMonitoredResourceDescriptorsFixedSizeCollection(pages, collectionSize); } } @@ -1496,7 +1495,8 @@ public static class ListLogsPage extends AbstractPage { private ListLogsPage( - PageContext context, ListLogsResponse response) { + @Nullable PageContext context, + @Nullable ListLogsResponse response) { super(context, response); } @@ -1506,13 +1506,14 @@ private static ListLogsPage createEmptyPage() { @Override protected ListLogsPage createPage( - PageContext context, ListLogsResponse response) { + @Nullable PageContext context, + @Nullable ListLogsResponse response) { return new ListLogsPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + @Nullable PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } @@ -1522,7 +1523,7 @@ public static class ListLogsFixedSizeCollection extends AbstractFixedSizeCollection< ListLogsRequest, ListLogsResponse, String, ListLogsPage, ListLogsFixedSizeCollection> { - private ListLogsFixedSizeCollection(List pages, int collectionSize) { + private ListLogsFixedSizeCollection(@Nullable List pages, int collectionSize) { super(pages, collectionSize); } @@ -1532,7 +1533,7 @@ private static ListLogsFixedSizeCollection createEmptyCollection() { @Override protected ListLogsFixedSizeCollection createCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { return new ListLogsFixedSizeCollection(pages, collectionSize); } } diff --git a/sdk-platform-java/test/integration/goldens/logging/src/com/google/cloud/logging/v2/LoggingSettings.java b/sdk-platform-java/test/integration/goldens/logging/src/com/google/cloud/logging/v2/LoggingSettings.java index 47c2092a47ac..4cfccc2c1095 100644 --- a/sdk-platform-java/test/integration/goldens/logging/src/com/google/cloud/logging/v2/LoggingSettings.java +++ b/sdk-platform-java/test/integration/goldens/logging/src/com/google/cloud/logging/v2/LoggingSettings.java @@ -50,6 +50,7 @@ import java.util.List; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -187,7 +188,7 @@ public static Builder newBuilder() { } /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { + public static Builder newBuilder(@Nullable ClientContext clientContext) { return new Builder(clientContext); } @@ -207,7 +208,7 @@ protected Builder() throws IOException { this(((ClientContext) null)); } - protected Builder(ClientContext clientContext) { + protected Builder(@Nullable ClientContext clientContext) { super(LoggingServiceV2StubSettings.newBuilder(clientContext)); } diff --git a/sdk-platform-java/test/integration/goldens/logging/src/com/google/cloud/logging/v2/MetricsClient.java b/sdk-platform-java/test/integration/goldens/logging/src/com/google/cloud/logging/v2/MetricsClient.java index 298de5923a4d..2c831a115d6b 100644 --- a/sdk-platform-java/test/integration/goldens/logging/src/com/google/cloud/logging/v2/MetricsClient.java +++ b/sdk-platform-java/test/integration/goldens/logging/src/com/google/cloud/logging/v2/MetricsClient.java @@ -42,6 +42,7 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -211,7 +212,7 @@ @NullMarked @Generated("by gapic-generator-java") public class MetricsClient implements BackgroundResource { - private final MetricsSettings settings; + @Nullable private final MetricsSettings settings; private final MetricsServiceV2Stub stub; /** Constructs an instance of MetricsClient with default settings. */ @@ -249,6 +250,7 @@ protected MetricsClient(MetricsServiceV2Stub stub) { this.stub = stub; } + @Nullable public final MetricsSettings getSettings() { return settings; } @@ -283,9 +285,7 @@ public MetricsServiceV2Stub getStub() { */ public final ListLogMetricsPagedResponse listLogMetrics(ProjectName parent) { ListLogMetricsRequest request = - ListLogMetricsRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .build(); + ListLogMetricsRequest.newBuilder().setParent(parent.toString()).build(); return listLogMetrics(request); } @@ -445,9 +445,7 @@ public final ListLogMetricsPagedResponse listLogMetrics(ListLogMetricsRequest re */ public final LogMetric getLogMetric(LogMetricName metricName) { GetLogMetricRequest request = - GetLogMetricRequest.newBuilder() - .setMetricName(metricName == null ? null : metricName.toString()) - .build(); + GetLogMetricRequest.newBuilder().setMetricName(metricName.toString()).build(); return getLogMetric(request); } @@ -562,10 +560,7 @@ public final UnaryCallable getLogMetricCallable( */ public final LogMetric createLogMetric(ProjectName parent, LogMetric metric) { CreateLogMetricRequest request = - CreateLogMetricRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .setMetric(metric) - .build(); + CreateLogMetricRequest.newBuilder().setParent(parent.toString()).setMetric(metric).build(); return createLogMetric(request); } @@ -688,7 +683,7 @@ public final UnaryCallable createLogMetricCal public final LogMetric updateLogMetric(LogMetricName metricName, LogMetric metric) { UpdateLogMetricRequest request = UpdateLogMetricRequest.newBuilder() - .setMetricName(metricName == null ? null : metricName.toString()) + .setMetricName(metricName.toString()) .setMetric(metric) .build(); return updateLogMetric(request); @@ -808,9 +803,7 @@ public final UnaryCallable updateLogMetricCal */ public final void deleteLogMetric(LogMetricName metricName) { DeleteLogMetricRequest request = - DeleteLogMetricRequest.newBuilder() - .setMetricName(metricName == null ? null : metricName.toString()) - .build(); + DeleteLogMetricRequest.newBuilder().setMetricName(metricName.toString()).build(); deleteLogMetric(request); } @@ -956,8 +949,8 @@ public static class ListLogMetricsPage ListLogMetricsRequest, ListLogMetricsResponse, LogMetric, ListLogMetricsPage> { private ListLogMetricsPage( - PageContext context, - ListLogMetricsResponse response) { + @Nullable PageContext context, + @Nullable ListLogMetricsResponse response) { super(context, response); } @@ -967,14 +960,14 @@ private static ListLogMetricsPage createEmptyPage() { @Override protected ListLogMetricsPage createPage( - PageContext context, - ListLogMetricsResponse response) { + @Nullable PageContext context, + @Nullable ListLogMetricsResponse response) { return new ListLogMetricsPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + @Nullable PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } @@ -988,7 +981,8 @@ public static class ListLogMetricsFixedSizeCollection ListLogMetricsPage, ListLogMetricsFixedSizeCollection> { - private ListLogMetricsFixedSizeCollection(List pages, int collectionSize) { + private ListLogMetricsFixedSizeCollection( + @Nullable List pages, int collectionSize) { super(pages, collectionSize); } @@ -998,7 +992,7 @@ private static ListLogMetricsFixedSizeCollection createEmptyCollection() { @Override protected ListLogMetricsFixedSizeCollection createCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { return new ListLogMetricsFixedSizeCollection(pages, collectionSize); } } diff --git a/sdk-platform-java/test/integration/goldens/logging/src/com/google/cloud/logging/v2/MetricsSettings.java b/sdk-platform-java/test/integration/goldens/logging/src/com/google/cloud/logging/v2/MetricsSettings.java index 5c6c60c6028e..52781eb9a482 100644 --- a/sdk-platform-java/test/integration/goldens/logging/src/com/google/cloud/logging/v2/MetricsSettings.java +++ b/sdk-platform-java/test/integration/goldens/logging/src/com/google/cloud/logging/v2/MetricsSettings.java @@ -42,6 +42,7 @@ import java.util.List; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -166,7 +167,7 @@ public static Builder newBuilder() { } /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { + public static Builder newBuilder(@Nullable ClientContext clientContext) { return new Builder(clientContext); } @@ -186,7 +187,7 @@ protected Builder() throws IOException { this(((ClientContext) null)); } - protected Builder(ClientContext clientContext) { + protected Builder(@Nullable ClientContext clientContext) { super(MetricsServiceV2StubSettings.newBuilder(clientContext)); } diff --git a/sdk-platform-java/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/ConfigServiceV2Stub.java b/sdk-platform-java/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/ConfigServiceV2Stub.java index 23c72df8c13f..2b02f58f200b 100644 --- a/sdk-platform-java/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/ConfigServiceV2Stub.java +++ b/sdk-platform-java/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/ConfigServiceV2Stub.java @@ -67,6 +67,7 @@ import com.google.protobuf.Empty; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -78,7 +79,7 @@ @Generated("by gapic-generator-java") public abstract class ConfigServiceV2Stub implements BackgroundResource { - public OperationsStub getOperationsStub() { + public @Nullable OperationsStub getOperationsStub() { throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); } diff --git a/sdk-platform-java/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/ConfigServiceV2StubSettings.java b/sdk-platform-java/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/ConfigServiceV2StubSettings.java index a9fb32db8506..5e79ac2fe41e 100644 --- a/sdk-platform-java/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/ConfigServiceV2StubSettings.java +++ b/sdk-platform-java/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/ConfigServiceV2StubSettings.java @@ -97,6 +97,7 @@ import java.util.List; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -640,7 +641,7 @@ public static Builder newBuilder() { } /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { + public static Builder newBuilder(@Nullable ClientContext clientContext) { return new Builder(clientContext); } @@ -783,7 +784,7 @@ protected Builder() { this(((ClientContext) null)); } - protected Builder(ClientContext clientContext) { + protected Builder(@Nullable ClientContext clientContext) { super(clientContext); listBucketsSettings = PagedCallSettings.newBuilder(LIST_BUCKETS_PAGE_STR_FACT); diff --git a/sdk-platform-java/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/LoggingServiceV2StubSettings.java b/sdk-platform-java/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/LoggingServiceV2StubSettings.java index 129d2dce53ce..939fee177384 100644 --- a/sdk-platform-java/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/LoggingServiceV2StubSettings.java +++ b/sdk-platform-java/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/LoggingServiceV2StubSettings.java @@ -76,6 +76,7 @@ import java.util.List; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -507,7 +508,7 @@ public static Builder newBuilder() { } /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { + public static Builder newBuilder(@Nullable ClientContext clientContext) { return new Builder(clientContext); } @@ -609,7 +610,7 @@ protected Builder() { this(((ClientContext) null)); } - protected Builder(ClientContext clientContext) { + protected Builder(@Nullable ClientContext clientContext) { super(clientContext); deleteLogSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); diff --git a/sdk-platform-java/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/MetricsServiceV2StubSettings.java b/sdk-platform-java/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/MetricsServiceV2StubSettings.java index 12c4baf63676..a50043d6550d 100644 --- a/sdk-platform-java/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/MetricsServiceV2StubSettings.java +++ b/sdk-platform-java/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/MetricsServiceV2StubSettings.java @@ -58,6 +58,7 @@ import java.util.List; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -279,7 +280,7 @@ public static Builder newBuilder() { } /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { + public static Builder newBuilder(@Nullable ClientContext clientContext) { return new Builder(clientContext); } @@ -364,7 +365,7 @@ protected Builder() { this(((ClientContext) null)); } - protected Builder(ClientContext clientContext) { + protected Builder(@Nullable ClientContext clientContext) { super(clientContext); listLogMetricsSettings = PagedCallSettings.newBuilder(LIST_LOG_METRICS_PAGE_STR_FACT); diff --git a/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/BillingAccountLocationName.java b/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/BillingAccountLocationName.java index 178a8e99bf96..6f1d5d8d7394 100644 --- a/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/BillingAccountLocationName.java +++ b/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/BillingAccountLocationName.java @@ -26,6 +26,7 @@ import java.util.Objects; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. @NullMarked @@ -73,6 +74,7 @@ public static String format(String billingAccount, String location) { return newBuilder().setBillingAccount(billingAccount).setLocation(location).build().toString(); } + @Nullable public static BillingAccountLocationName parse(String formattedString) { if (formattedString.isEmpty()) { return null; @@ -92,7 +94,7 @@ public static List parseList(List formattedS return list; } - public static List toStringList(List values) { + public static List toStringList(List<@Nullable BillingAccountLocationName> values) { List list = new ArrayList<>(values.size()); for (BillingAccountLocationName value : values) { if (value == null) { @@ -138,7 +140,7 @@ public String toString() { } @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (o == this) { return true; } diff --git a/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/BillingAccountName.java b/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/BillingAccountName.java index 7a0fcf839421..3ffdc395e966 100644 --- a/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/BillingAccountName.java +++ b/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/BillingAccountName.java @@ -26,6 +26,7 @@ import java.util.Objects; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. @NullMarked @@ -65,6 +66,7 @@ public static String format(String billingAccount) { return newBuilder().setBillingAccount(billingAccount).build().toString(); } + @Nullable public static BillingAccountName parse(String formattedString) { if (formattedString.isEmpty()) { return null; @@ -83,7 +85,7 @@ public static List parseList(List formattedStrings) return list; } - public static List toStringList(List values) { + public static List toStringList(List<@Nullable BillingAccountName> values) { List list = new ArrayList<>(values.size()); for (BillingAccountName value : values) { if (value == null) { @@ -125,7 +127,7 @@ public String toString() { } @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (o == this) { return true; } diff --git a/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/CmekSettingsName.java b/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/CmekSettingsName.java index 103c3a818915..2340bb389b6d 100644 --- a/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/CmekSettingsName.java +++ b/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/CmekSettingsName.java @@ -27,6 +27,7 @@ import java.util.Objects; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. @NullMarked @@ -168,6 +169,7 @@ public static String formatBillingAccountName(String billingAccount) { return newBillingAccountBuilder().setBillingAccount(billingAccount).build().toString(); } + @Nullable public static CmekSettingsName parse(String formattedString) { if (formattedString.isEmpty()) { return null; @@ -196,7 +198,7 @@ public static List parseList(List formattedStrings) { return list; } - public static List toStringList(List values) { + public static List toStringList(List<@Nullable CmekSettingsName> values) { List list = new ArrayList<>(values.size()); for (CmekSettingsName value : values) { if (value == null) { @@ -250,7 +252,7 @@ public String toString() { } @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (o == this) { return true; } diff --git a/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/FolderLocationName.java b/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/FolderLocationName.java index 4676ef17d701..6a8cb0d66381 100644 --- a/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/FolderLocationName.java +++ b/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/FolderLocationName.java @@ -26,6 +26,7 @@ import java.util.Objects; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. @NullMarked @@ -72,6 +73,7 @@ public static String format(String folder, String location) { return newBuilder().setFolder(folder).setLocation(location).build().toString(); } + @Nullable public static FolderLocationName parse(String formattedString) { if (formattedString.isEmpty()) { return null; @@ -90,7 +92,7 @@ public static List parseList(List formattedStrings) return list; } - public static List toStringList(List values) { + public static List toStringList(List<@Nullable FolderLocationName> values) { List list = new ArrayList<>(values.size()); for (FolderLocationName value : values) { if (value == null) { @@ -135,7 +137,7 @@ public String toString() { } @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (o == this) { return true; } diff --git a/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/FolderName.java b/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/FolderName.java index ad975e6564ff..a5bb03362667 100644 --- a/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/FolderName.java +++ b/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/FolderName.java @@ -26,6 +26,7 @@ import java.util.Objects; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. @NullMarked @@ -65,6 +66,7 @@ public static String format(String folder) { return newBuilder().setFolder(folder).build().toString(); } + @Nullable public static FolderName parse(String formattedString) { if (formattedString.isEmpty()) { return null; @@ -83,7 +85,7 @@ public static List parseList(List formattedStrings) { return list; } - public static List toStringList(List values) { + public static List toStringList(List<@Nullable FolderName> values) { List list = new ArrayList<>(values.size()); for (FolderName value : values) { if (value == null) { @@ -125,7 +127,7 @@ public String toString() { } @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (o == this) { return true; } diff --git a/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/LocationName.java b/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/LocationName.java index e869cb57f633..29b5002ba954 100644 --- a/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/LocationName.java +++ b/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/LocationName.java @@ -26,6 +26,7 @@ import java.util.Objects; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. @NullMarked @@ -72,6 +73,7 @@ public static String format(String project, String location) { return newBuilder().setProject(project).setLocation(location).build().toString(); } + @Nullable public static LocationName parse(String formattedString) { if (formattedString.isEmpty()) { return null; @@ -90,7 +92,7 @@ public static List parseList(List formattedStrings) { return list; } - public static List toStringList(List values) { + public static List toStringList(List<@Nullable LocationName> values) { List list = new ArrayList<>(values.size()); for (LocationName value : values) { if (value == null) { @@ -135,7 +137,7 @@ public String toString() { } @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (o == this) { return true; } diff --git a/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/LogBucketName.java b/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/LogBucketName.java index d5af1c62075b..8f3e4cd531a1 100644 --- a/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/LogBucketName.java +++ b/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/LogBucketName.java @@ -27,6 +27,7 @@ import java.util.Objects; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. @NullMarked @@ -237,6 +238,7 @@ public static String formatBillingAccountLocationBucketName( .toString(); } + @Nullable public static LogBucketName parse(String formattedString) { if (formattedString.isEmpty()) { return null; @@ -269,7 +271,7 @@ public static List parseList(List formattedStrings) { return list; } - public static List toStringList(List values) { + public static List toStringList(List<@Nullable LogBucketName> values) { List list = new ArrayList<>(values.size()); for (LogBucketName value : values) { if (value == null) { @@ -329,7 +331,7 @@ public String toString() { } @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (o == this) { return true; } diff --git a/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/LogExclusionName.java b/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/LogExclusionName.java index f5deda544cd4..78cdb03449c5 100644 --- a/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/LogExclusionName.java +++ b/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/LogExclusionName.java @@ -27,6 +27,7 @@ import java.util.Objects; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. @NullMarked @@ -195,6 +196,7 @@ public static String formatBillingAccountExclusionName(String billingAccount, St .toString(); } + @Nullable public static LogExclusionName parse(String formattedString) { if (formattedString.isEmpty()) { return null; @@ -224,7 +226,7 @@ public static List parseList(List formattedStrings) { return list; } - public static List toStringList(List values) { + public static List toStringList(List<@Nullable LogExclusionName> values) { List list = new ArrayList<>(values.size()); for (LogExclusionName value : values) { if (value == null) { @@ -281,7 +283,7 @@ public String toString() { } @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (o == this) { return true; } diff --git a/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/LogMetricName.java b/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/LogMetricName.java index 4ed25f0ecaf5..a1251454547f 100644 --- a/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/LogMetricName.java +++ b/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/LogMetricName.java @@ -26,6 +26,7 @@ import java.util.Objects; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. @NullMarked @@ -72,6 +73,7 @@ public static String format(String project, String metric) { return newBuilder().setProject(project).setMetric(metric).build().toString(); } + @Nullable public static LogMetricName parse(String formattedString) { if (formattedString.isEmpty()) { return null; @@ -90,7 +92,7 @@ public static List parseList(List formattedStrings) { return list; } - public static List toStringList(List values) { + public static List toStringList(List<@Nullable LogMetricName> values) { List list = new ArrayList<>(values.size()); for (LogMetricName value : values) { if (value == null) { @@ -135,7 +137,7 @@ public String toString() { } @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (o == this) { return true; } diff --git a/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/LogName.java b/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/LogName.java index 3e7c291fb43c..cd30e16ee3c5 100644 --- a/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/LogName.java +++ b/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/LogName.java @@ -27,6 +27,7 @@ import java.util.Objects; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. @NullMarked @@ -182,6 +183,7 @@ public static String formatBillingAccountLogName(String billingAccount, String l .toString(); } + @Nullable public static LogName parse(String formattedString) { if (formattedString.isEmpty()) { return null; @@ -210,7 +212,7 @@ public static List parseList(List formattedStrings) { return list; } - public static List toStringList(List values) { + public static List toStringList(List<@Nullable LogName> values) { List list = new ArrayList<>(values.size()); for (LogName value : values) { if (value == null) { @@ -267,7 +269,7 @@ public String toString() { } @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (o == this) { return true; } diff --git a/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/LogSinkName.java b/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/LogSinkName.java index 9f8f86acccb5..8189d4830195 100644 --- a/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/LogSinkName.java +++ b/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/LogSinkName.java @@ -27,6 +27,7 @@ import java.util.Objects; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. @NullMarked @@ -186,6 +187,7 @@ public static String formatBillingAccountSinkName(String billingAccount, String .toString(); } + @Nullable public static LogSinkName parse(String formattedString) { if (formattedString.isEmpty()) { return null; @@ -214,7 +216,7 @@ public static List parseList(List formattedStrings) { return list; } - public static List toStringList(List values) { + public static List toStringList(List<@Nullable LogSinkName> values) { List list = new ArrayList<>(values.size()); for (LogSinkName value : values) { if (value == null) { @@ -271,7 +273,7 @@ public String toString() { } @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (o == this) { return true; } diff --git a/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/LogViewName.java b/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/LogViewName.java index 83f47d206990..5518b73a9e1b 100644 --- a/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/LogViewName.java +++ b/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/LogViewName.java @@ -27,6 +27,7 @@ import java.util.Objects; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. @NullMarked @@ -266,6 +267,7 @@ public static String formatBillingAccountLocationBucketViewName( .toString(); } + @Nullable public static LogViewName parse(String formattedString) { if (formattedString.isEmpty()) { return null; @@ -310,7 +312,7 @@ public static List parseList(List formattedStrings) { return list; } - public static List toStringList(List values) { + public static List toStringList(List<@Nullable LogViewName> values) { List list = new ArrayList<>(values.size()); for (LogViewName value : values) { if (value == null) { @@ -373,7 +375,7 @@ public String toString() { } @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (o == this) { return true; } diff --git a/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/OrganizationLocationName.java b/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/OrganizationLocationName.java index 63390df42c17..d2969e9383bf 100644 --- a/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/OrganizationLocationName.java +++ b/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/OrganizationLocationName.java @@ -26,6 +26,7 @@ import java.util.Objects; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. @NullMarked @@ -72,6 +73,7 @@ public static String format(String organization, String location) { return newBuilder().setOrganization(organization).setLocation(location).build().toString(); } + @Nullable public static OrganizationLocationName parse(String formattedString) { if (formattedString.isEmpty()) { return null; @@ -90,7 +92,7 @@ public static List parseList(List formattedStr return list; } - public static List toStringList(List values) { + public static List toStringList(List<@Nullable OrganizationLocationName> values) { List list = new ArrayList<>(values.size()); for (OrganizationLocationName value : values) { if (value == null) { @@ -135,7 +137,7 @@ public String toString() { } @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (o == this) { return true; } diff --git a/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/OrganizationName.java b/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/OrganizationName.java index d90f4ff73657..b7f1eef06b0c 100644 --- a/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/OrganizationName.java +++ b/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/OrganizationName.java @@ -26,6 +26,7 @@ import java.util.Objects; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. @NullMarked @@ -65,6 +66,7 @@ public static String format(String organization) { return newBuilder().setOrganization(organization).build().toString(); } + @Nullable public static OrganizationName parse(String formattedString) { if (formattedString.isEmpty()) { return null; @@ -83,7 +85,7 @@ public static List parseList(List formattedStrings) { return list; } - public static List toStringList(List values) { + public static List toStringList(List<@Nullable OrganizationName> values) { List list = new ArrayList<>(values.size()); for (OrganizationName value : values) { if (value == null) { @@ -125,7 +127,7 @@ public String toString() { } @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (o == this) { return true; } diff --git a/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/ProjectName.java b/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/ProjectName.java index 2cc797351ff5..a1a5a7fc7b4a 100644 --- a/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/ProjectName.java +++ b/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/ProjectName.java @@ -26,6 +26,7 @@ import java.util.Objects; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. @NullMarked @@ -65,6 +66,7 @@ public static String format(String project) { return newBuilder().setProject(project).build().toString(); } + @Nullable public static ProjectName parse(String formattedString) { if (formattedString.isEmpty()) { return null; @@ -83,7 +85,7 @@ public static List parseList(List formattedStrings) { return list; } - public static List toStringList(List values) { + public static List toStringList(List<@Nullable ProjectName> values) { List list = new ArrayList<>(values.size()); for (ProjectName value : values) { if (value == null) { @@ -125,7 +127,7 @@ public String toString() { } @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (o == this) { return true; } diff --git a/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/SettingsName.java b/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/SettingsName.java index 4c3f9c69f7a6..ea574f3043eb 100644 --- a/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/SettingsName.java +++ b/sdk-platform-java/test/integration/goldens/logging/src/com/google/logging/v2/SettingsName.java @@ -27,6 +27,7 @@ import java.util.Objects; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. @NullMarked @@ -168,6 +169,7 @@ public static String formatBillingAccountName(String billingAccount) { return newBillingAccountBuilder().setBillingAccount(billingAccount).build().toString(); } + @Nullable public static SettingsName parse(String formattedString) { if (formattedString.isEmpty()) { return null; @@ -196,7 +198,7 @@ public static List parseList(List formattedStrings) { return list; } - public static List toStringList(List values) { + public static List toStringList(List<@Nullable SettingsName> values) { List list = new ArrayList<>(values.size()); for (SettingsName value : values) { if (value == null) { @@ -250,7 +252,7 @@ public String toString() { } @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (o == this) { return true; } diff --git a/sdk-platform-java/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SchemaServiceClient.java b/sdk-platform-java/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SchemaServiceClient.java index 9ed9579c9353..0195246e39a9 100644 --- a/sdk-platform-java/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SchemaServiceClient.java +++ b/sdk-platform-java/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SchemaServiceClient.java @@ -55,6 +55,7 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -362,7 +363,7 @@ @NullMarked @Generated("by gapic-generator-java") public class SchemaServiceClient implements BackgroundResource { - private final SchemaServiceSettings settings; + @Nullable private final SchemaServiceSettings settings; private final SchemaServiceStub stub; /** Constructs an instance of SchemaServiceClient with default settings. */ @@ -402,6 +403,7 @@ protected SchemaServiceClient(SchemaServiceStub stub) { this.stub = stub; } + @Nullable public final SchemaServiceSettings getSettings() { return settings; } @@ -444,7 +446,7 @@ public SchemaServiceStub getStub() { public final Schema createSchema(ProjectName parent, Schema schema, String schemaId) { CreateSchemaRequest request = CreateSchemaRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) + .setParent(parent.toString()) .setSchema(schema) .setSchemaId(schemaId) .build(); @@ -574,8 +576,7 @@ public final UnaryCallable createSchemaCallable() { * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Schema getSchema(SchemaName name) { - GetSchemaRequest request = - GetSchemaRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + GetSchemaRequest request = GetSchemaRequest.newBuilder().setName(name.toString()).build(); return getSchema(request); } @@ -689,9 +690,7 @@ public final UnaryCallable getSchemaCallable() { */ public final ListSchemasPagedResponse listSchemas(ProjectName parent) { ListSchemasRequest request = - ListSchemasRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .build(); + ListSchemasRequest.newBuilder().setParent(parent.toString()).build(); return listSchemas(request); } @@ -854,9 +853,7 @@ public final UnaryCallable listSchemasC */ public final ListSchemaRevisionsPagedResponse listSchemaRevisions(SchemaName name) { ListSchemaRevisionsRequest request = - ListSchemaRevisionsRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .build(); + ListSchemaRevisionsRequest.newBuilder().setName(name.toString()).build(); return listSchemaRevisions(request); } @@ -1024,10 +1021,7 @@ public final ListSchemaRevisionsPagedResponse listSchemaRevisions( */ public final Schema commitSchema(SchemaName name, Schema schema) { CommitSchemaRequest request = - CommitSchemaRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .setSchema(schema) - .build(); + CommitSchemaRequest.newBuilder().setName(name.toString()).setSchema(schema).build(); return commitSchema(request); } @@ -1146,7 +1140,7 @@ public final UnaryCallable commitSchemaCallable() { public final Schema rollbackSchema(SchemaName name, String revisionId) { RollbackSchemaRequest request = RollbackSchemaRequest.newBuilder() - .setName(name == null ? null : name.toString()) + .setName(name.toString()) .setRevisionId(revisionId) .build(); return rollbackSchema(request); @@ -1270,7 +1264,7 @@ public final UnaryCallable rollbackSchemaCallable public final Schema deleteSchemaRevision(SchemaName name, String revisionId) { DeleteSchemaRevisionRequest request = DeleteSchemaRevisionRequest.newBuilder() - .setName(name == null ? null : name.toString()) + .setName(name.toString()) .setRevisionId(revisionId) .build(); return deleteSchemaRevision(request); @@ -1390,8 +1384,7 @@ public final UnaryCallable deleteSchemaRevi * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final void deleteSchema(SchemaName name) { - DeleteSchemaRequest request = - DeleteSchemaRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + DeleteSchemaRequest request = DeleteSchemaRequest.newBuilder().setName(name.toString()).build(); deleteSchema(request); } @@ -1503,10 +1496,7 @@ public final UnaryCallable deleteSchemaCallable() { */ public final ValidateSchemaResponse validateSchema(ProjectName parent, Schema schema) { ValidateSchemaRequest request = - ValidateSchemaRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .setSchema(schema) - .build(); + ValidateSchemaRequest.newBuilder().setParent(parent.toString()).setSchema(schema).build(); return validateSchema(request); } @@ -1907,8 +1897,8 @@ public static class ListSchemasPage extends AbstractPage { private ListSchemasPage( - PageContext context, - ListSchemasResponse response) { + @Nullable PageContext context, + @Nullable ListSchemasResponse response) { super(context, response); } @@ -1918,14 +1908,14 @@ private static ListSchemasPage createEmptyPage() { @Override protected ListSchemasPage createPage( - PageContext context, - ListSchemasResponse response) { + @Nullable PageContext context, + @Nullable ListSchemasResponse response) { return new ListSchemasPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + @Nullable PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } @@ -1939,7 +1929,8 @@ public static class ListSchemasFixedSizeCollection ListSchemasPage, ListSchemasFixedSizeCollection> { - private ListSchemasFixedSizeCollection(List pages, int collectionSize) { + private ListSchemasFixedSizeCollection( + @Nullable List pages, int collectionSize) { super(pages, collectionSize); } @@ -1949,7 +1940,7 @@ private static ListSchemasFixedSizeCollection createEmptyCollection() { @Override protected ListSchemasFixedSizeCollection createCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { return new ListSchemasFixedSizeCollection(pages, collectionSize); } } @@ -1986,8 +1977,9 @@ public static class ListSchemaRevisionsPage ListSchemaRevisionsPage> { private ListSchemaRevisionsPage( - PageContext context, - ListSchemaRevisionsResponse response) { + @Nullable + PageContext context, + @Nullable ListSchemaRevisionsResponse response) { super(context, response); } @@ -1997,14 +1989,16 @@ private static ListSchemaRevisionsPage createEmptyPage() { @Override protected ListSchemaRevisionsPage createPage( - PageContext context, - ListSchemaRevisionsResponse response) { + @Nullable + PageContext context, + @Nullable ListSchemaRevisionsResponse response) { return new ListSchemaRevisionsPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + @Nullable + PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } @@ -2019,7 +2013,7 @@ public static class ListSchemaRevisionsFixedSizeCollection ListSchemaRevisionsFixedSizeCollection> { private ListSchemaRevisionsFixedSizeCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { super(pages, collectionSize); } @@ -2029,7 +2023,7 @@ private static ListSchemaRevisionsFixedSizeCollection createEmptyCollection() { @Override protected ListSchemaRevisionsFixedSizeCollection createCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { return new ListSchemaRevisionsFixedSizeCollection(pages, collectionSize); } } diff --git a/sdk-platform-java/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SchemaServiceSettings.java b/sdk-platform-java/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SchemaServiceSettings.java index 3a1bb72aaf88..22ddbf0c691b 100644 --- a/sdk-platform-java/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SchemaServiceSettings.java +++ b/sdk-platform-java/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SchemaServiceSettings.java @@ -56,6 +56,7 @@ import java.util.List; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -224,7 +225,7 @@ public static Builder newBuilder() { } /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { + public static Builder newBuilder(@Nullable ClientContext clientContext) { return new Builder(clientContext); } @@ -244,7 +245,7 @@ protected Builder() throws IOException { this(((ClientContext) null)); } - protected Builder(ClientContext clientContext) { + protected Builder(@Nullable ClientContext clientContext) { super(SchemaServiceStubSettings.newBuilder(clientContext)); } diff --git a/sdk-platform-java/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SubscriptionAdminClient.java b/sdk-platform-java/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SubscriptionAdminClient.java index 504c1ef5067e..b59b345356a3 100644 --- a/sdk-platform-java/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SubscriptionAdminClient.java +++ b/sdk-platform-java/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SubscriptionAdminClient.java @@ -66,6 +66,7 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -484,7 +485,7 @@ @NullMarked @Generated("by gapic-generator-java") public class SubscriptionAdminClient implements BackgroundResource { - private final SubscriptionAdminSettings settings; + @Nullable private final SubscriptionAdminSettings settings; private final SubscriberStub stub; /** Constructs an instance of SubscriptionAdminClient with default settings. */ @@ -524,6 +525,7 @@ protected SubscriptionAdminClient(SubscriberStub stub) { this.stub = stub; } + @Nullable public final SubscriptionAdminSettings getSettings() { return settings; } @@ -595,8 +597,8 @@ public final Subscription createSubscription( SubscriptionName name, TopicName topic, PushConfig pushConfig, int ackDeadlineSeconds) { Subscription request = Subscription.newBuilder() - .setName(name == null ? null : name.toString()) - .setTopic(topic == null ? null : topic.toString()) + .setName(name.toString()) + .setTopic(topic.toString()) .setPushConfig(pushConfig) .setAckDeadlineSeconds(ackDeadlineSeconds) .build(); @@ -666,7 +668,7 @@ public final Subscription createSubscription( SubscriptionName name, String topic, PushConfig pushConfig, int ackDeadlineSeconds) { Subscription request = Subscription.newBuilder() - .setName(name == null ? null : name.toString()) + .setName(name.toString()) .setTopic(topic) .setPushConfig(pushConfig) .setAckDeadlineSeconds(ackDeadlineSeconds) @@ -738,7 +740,7 @@ public final Subscription createSubscription( Subscription request = Subscription.newBuilder() .setName(name) - .setTopic(topic == null ? null : topic.toString()) + .setTopic(topic.toString()) .setPushConfig(pushConfig) .setAckDeadlineSeconds(ackDeadlineSeconds) .build(); @@ -944,9 +946,7 @@ public final UnaryCallable createSubscriptionCallabl */ public final Subscription getSubscription(SubscriptionName subscription) { GetSubscriptionRequest request = - GetSubscriptionRequest.newBuilder() - .setSubscription(subscription == null ? null : subscription.toString()) - .build(); + GetSubscriptionRequest.newBuilder().setSubscription(subscription.toString()).build(); return getSubscription(request); } @@ -1120,9 +1120,7 @@ public final UnaryCallable updateSubscr */ public final ListSubscriptionsPagedResponse listSubscriptions(ProjectName project) { ListSubscriptionsRequest request = - ListSubscriptionsRequest.newBuilder() - .setProject(project == null ? null : project.toString()) - .build(); + ListSubscriptionsRequest.newBuilder().setProject(project.toString()).build(); return listSubscriptions(request); } @@ -1288,9 +1286,7 @@ public final ListSubscriptionsPagedResponse listSubscriptions(ListSubscriptionsR */ public final void deleteSubscription(SubscriptionName subscription) { DeleteSubscriptionRequest request = - DeleteSubscriptionRequest.newBuilder() - .setSubscription(subscription == null ? null : subscription.toString()) - .build(); + DeleteSubscriptionRequest.newBuilder().setSubscription(subscription.toString()).build(); deleteSubscription(request); } @@ -1426,7 +1422,7 @@ public final void modifyAckDeadline( SubscriptionName subscription, List ackIds, int ackDeadlineSeconds) { ModifyAckDeadlineRequest request = ModifyAckDeadlineRequest.newBuilder() - .setSubscription(subscription == null ? null : subscription.toString()) + .setSubscription(subscription.toString()) .addAllAckIds(ackIds) .setAckDeadlineSeconds(ackDeadlineSeconds) .build(); @@ -1577,7 +1573,7 @@ public final UnaryCallable modifyAckDeadlineCal public final void acknowledge(SubscriptionName subscription, List ackIds) { AcknowledgeRequest request = AcknowledgeRequest.newBuilder() - .setSubscription(subscription == null ? null : subscription.toString()) + .setSubscription(subscription.toString()) .addAllAckIds(ackIds) .build(); acknowledge(request); @@ -1712,7 +1708,7 @@ public final UnaryCallable acknowledgeCallable() { public final PullResponse pull(SubscriptionName subscription, int maxMessages) { PullRequest request = PullRequest.newBuilder() - .setSubscription(subscription == null ? null : subscription.toString()) + .setSubscription(subscription.toString()) .setMaxMessages(maxMessages) .build(); return pull(request); @@ -1788,7 +1784,7 @@ public final PullResponse pull( SubscriptionName subscription, boolean returnImmediately, int maxMessages) { PullRequest request = PullRequest.newBuilder() - .setSubscription(subscription == null ? null : subscription.toString()) + .setSubscription(subscription.toString()) .setReturnImmediately(returnImmediately) .setMaxMessages(maxMessages) .build(); @@ -1978,7 +1974,7 @@ public final UnaryCallable pullCallable() { public final void modifyPushConfig(SubscriptionName subscription, PushConfig pushConfig) { ModifyPushConfigRequest request = ModifyPushConfigRequest.newBuilder() - .setSubscription(subscription == null ? null : subscription.toString()) + .setSubscription(subscription.toString()) .setPushConfig(pushConfig) .build(); modifyPushConfig(request); @@ -2120,9 +2116,7 @@ public final UnaryCallable modifyPushConfigCalla */ public final Snapshot getSnapshot(SnapshotName snapshot) { GetSnapshotRequest request = - GetSnapshotRequest.newBuilder() - .setSnapshot(snapshot == null ? null : snapshot.toString()) - .build(); + GetSnapshotRequest.newBuilder().setSnapshot(snapshot.toString()).build(); return getSnapshot(request); } @@ -2247,9 +2241,7 @@ public final UnaryCallable getSnapshotCallable() { */ public final ListSnapshotsPagedResponse listSnapshots(ProjectName project) { ListSnapshotsRequest request = - ListSnapshotsRequest.newBuilder() - .setProject(project == null ? null : project.toString()) - .build(); + ListSnapshotsRequest.newBuilder().setProject(project.toString()).build(); return listSnapshots(request); } @@ -2445,8 +2437,8 @@ public final UnaryCallable listSnap public final Snapshot createSnapshot(SnapshotName name, SubscriptionName subscription) { CreateSnapshotRequest request = CreateSnapshotRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .setSubscription(subscription == null ? null : subscription.toString()) + .setName(name.toString()) + .setSubscription(subscription.toString()) .build(); return createSnapshot(request); } @@ -2498,7 +2490,7 @@ public final Snapshot createSnapshot(SnapshotName name, SubscriptionName subscri public final Snapshot createSnapshot(SnapshotName name, String subscription) { CreateSnapshotRequest request = CreateSnapshotRequest.newBuilder() - .setName(name == null ? null : name.toString()) + .setName(name.toString()) .setSubscription(subscription) .build(); return createSnapshot(request); @@ -2552,7 +2544,7 @@ public final Snapshot createSnapshot(String name, SubscriptionName subscription) CreateSnapshotRequest request = CreateSnapshotRequest.newBuilder() .setName(name) - .setSubscription(subscription == null ? null : subscription.toString()) + .setSubscription(subscription.toString()) .build(); return createSnapshot(request); } @@ -2783,9 +2775,7 @@ public final UnaryCallable updateSnapshotCallab */ public final void deleteSnapshot(SnapshotName snapshot) { DeleteSnapshotRequest request = - DeleteSnapshotRequest.newBuilder() - .setSnapshot(snapshot == null ? null : snapshot.toString()) - .build(); + DeleteSnapshotRequest.newBuilder().setSnapshot(snapshot.toString()).build(); deleteSnapshot(request); } @@ -3209,8 +3199,9 @@ public static class ListSubscriptionsPage ListSubscriptionsPage> { private ListSubscriptionsPage( - PageContext context, - ListSubscriptionsResponse response) { + @Nullable + PageContext context, + @Nullable ListSubscriptionsResponse response) { super(context, response); } @@ -3220,14 +3211,16 @@ private static ListSubscriptionsPage createEmptyPage() { @Override protected ListSubscriptionsPage createPage( - PageContext context, - ListSubscriptionsResponse response) { + @Nullable + PageContext context, + @Nullable ListSubscriptionsResponse response) { return new ListSubscriptionsPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + @Nullable + PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } @@ -3242,7 +3235,7 @@ public static class ListSubscriptionsFixedSizeCollection ListSubscriptionsFixedSizeCollection> { private ListSubscriptionsFixedSizeCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { super(pages, collectionSize); } @@ -3252,7 +3245,7 @@ private static ListSubscriptionsFixedSizeCollection createEmptyCollection() { @Override protected ListSubscriptionsFixedSizeCollection createCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { return new ListSubscriptionsFixedSizeCollection(pages, collectionSize); } } @@ -3286,8 +3279,8 @@ public static class ListSnapshotsPage ListSnapshotsRequest, ListSnapshotsResponse, Snapshot, ListSnapshotsPage> { private ListSnapshotsPage( - PageContext context, - ListSnapshotsResponse response) { + @Nullable PageContext context, + @Nullable ListSnapshotsResponse response) { super(context, response); } @@ -3297,14 +3290,14 @@ private static ListSnapshotsPage createEmptyPage() { @Override protected ListSnapshotsPage createPage( - PageContext context, - ListSnapshotsResponse response) { + @Nullable PageContext context, + @Nullable ListSnapshotsResponse response) { return new ListSnapshotsPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + @Nullable PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } @@ -3318,7 +3311,8 @@ public static class ListSnapshotsFixedSizeCollection ListSnapshotsPage, ListSnapshotsFixedSizeCollection> { - private ListSnapshotsFixedSizeCollection(List pages, int collectionSize) { + private ListSnapshotsFixedSizeCollection( + @Nullable List pages, int collectionSize) { super(pages, collectionSize); } @@ -3328,7 +3322,7 @@ private static ListSnapshotsFixedSizeCollection createEmptyCollection() { @Override protected ListSnapshotsFixedSizeCollection createCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { return new ListSnapshotsFixedSizeCollection(pages, collectionSize); } } diff --git a/sdk-platform-java/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SubscriptionAdminSettings.java b/sdk-platform-java/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SubscriptionAdminSettings.java index b5dea6fd00af..dec961b8b2c8 100644 --- a/sdk-platform-java/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SubscriptionAdminSettings.java +++ b/sdk-platform-java/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SubscriptionAdminSettings.java @@ -64,6 +64,7 @@ import java.util.List; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -263,7 +264,7 @@ public static Builder newBuilder() { } /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { + public static Builder newBuilder(@Nullable ClientContext clientContext) { return new Builder(clientContext); } @@ -283,7 +284,7 @@ protected Builder() throws IOException { this(((ClientContext) null)); } - protected Builder(ClientContext clientContext) { + protected Builder(@Nullable ClientContext clientContext) { super(SubscriberStubSettings.newBuilder(clientContext)); } diff --git a/sdk-platform-java/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/TopicAdminClient.java b/sdk-platform-java/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/TopicAdminClient.java index 4017bf13db75..51ff7afe63e8 100644 --- a/sdk-platform-java/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/TopicAdminClient.java +++ b/sdk-platform-java/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/TopicAdminClient.java @@ -55,6 +55,7 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -338,7 +339,7 @@ @NullMarked @Generated("by gapic-generator-java") public class TopicAdminClient implements BackgroundResource { - private final TopicAdminSettings settings; + @Nullable private final TopicAdminSettings settings; private final PublisherStub stub; /** Constructs an instance of TopicAdminClient with default settings. */ @@ -376,6 +377,7 @@ protected TopicAdminClient(PublisherStub stub) { this.stub = stub; } + @Nullable public final TopicAdminSettings getSettings() { return settings; } @@ -411,7 +413,7 @@ public PublisherStub getStub() { * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Topic createTopic(TopicName name) { - Topic request = Topic.newBuilder().setName(name == null ? null : name.toString()).build(); + Topic request = Topic.newBuilder().setName(name.toString()).build(); return createTopic(request); } @@ -598,10 +600,7 @@ public final UnaryCallable updateTopicCallable() { */ public final PublishResponse publish(TopicName topic, List messages) { PublishRequest request = - PublishRequest.newBuilder() - .setTopic(topic == null ? null : topic.toString()) - .addAllMessages(messages) - .build(); + PublishRequest.newBuilder().setTopic(topic.toString()).addAllMessages(messages).build(); return publish(request); } @@ -715,8 +714,7 @@ public final UnaryCallable publishCallable() { * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Topic getTopic(TopicName topic) { - GetTopicRequest request = - GetTopicRequest.newBuilder().setTopic(topic == null ? null : topic.toString()).build(); + GetTopicRequest request = GetTopicRequest.newBuilder().setTopic(topic.toString()).build(); return getTopic(request); } @@ -828,9 +826,7 @@ public final UnaryCallable getTopicCallable() { */ public final ListTopicsPagedResponse listTopics(ProjectName project) { ListTopicsRequest request = - ListTopicsRequest.newBuilder() - .setProject(project == null ? null : project.toString()) - .build(); + ListTopicsRequest.newBuilder().setProject(project.toString()).build(); return listTopics(request); } @@ -990,9 +986,7 @@ public final UnaryCallable listTopicsCall */ public final ListTopicSubscriptionsPagedResponse listTopicSubscriptions(TopicName topic) { ListTopicSubscriptionsRequest request = - ListTopicSubscriptionsRequest.newBuilder() - .setTopic(topic == null ? null : topic.toString()) - .build(); + ListTopicSubscriptionsRequest.newBuilder().setTopic(topic.toString()).build(); return listTopicSubscriptions(request); } @@ -1161,9 +1155,7 @@ public final ListTopicSubscriptionsPagedResponse listTopicSubscriptions( */ public final ListTopicSnapshotsPagedResponse listTopicSnapshots(TopicName topic) { ListTopicSnapshotsRequest request = - ListTopicSnapshotsRequest.newBuilder() - .setTopic(topic == null ? null : topic.toString()) - .build(); + ListTopicSnapshotsRequest.newBuilder().setTopic(topic.toString()).build(); return listTopicSnapshots(request); } @@ -1341,8 +1333,7 @@ public final ListTopicSnapshotsPagedResponse listTopicSnapshots( * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final void deleteTopic(TopicName topic) { - DeleteTopicRequest request = - DeleteTopicRequest.newBuilder().setTopic(topic == null ? null : topic.toString()).build(); + DeleteTopicRequest request = DeleteTopicRequest.newBuilder().setTopic(topic.toString()).build(); deleteTopic(request); } @@ -1745,8 +1736,8 @@ public static class ListTopicsPage extends AbstractPage { private ListTopicsPage( - PageContext context, - ListTopicsResponse response) { + @Nullable PageContext context, + @Nullable ListTopicsResponse response) { super(context, response); } @@ -1756,14 +1747,14 @@ private static ListTopicsPage createEmptyPage() { @Override protected ListTopicsPage createPage( - PageContext context, - ListTopicsResponse response) { + @Nullable PageContext context, + @Nullable ListTopicsResponse response) { return new ListTopicsPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + @Nullable PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } @@ -1777,7 +1768,8 @@ public static class ListTopicsFixedSizeCollection ListTopicsPage, ListTopicsFixedSizeCollection> { - private ListTopicsFixedSizeCollection(List pages, int collectionSize) { + private ListTopicsFixedSizeCollection( + @Nullable List pages, int collectionSize) { super(pages, collectionSize); } @@ -1787,7 +1779,7 @@ private static ListTopicsFixedSizeCollection createEmptyCollection() { @Override protected ListTopicsFixedSizeCollection createCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { return new ListTopicsFixedSizeCollection(pages, collectionSize); } } @@ -1824,8 +1816,10 @@ public static class ListTopicSubscriptionsPage ListTopicSubscriptionsPage> { private ListTopicSubscriptionsPage( - PageContext context, - ListTopicSubscriptionsResponse response) { + @Nullable + PageContext + context, + @Nullable ListTopicSubscriptionsResponse response) { super(context, response); } @@ -1835,14 +1829,18 @@ private static ListTopicSubscriptionsPage createEmptyPage() { @Override protected ListTopicSubscriptionsPage createPage( - PageContext context, - ListTopicSubscriptionsResponse response) { + @Nullable + PageContext + context, + @Nullable ListTopicSubscriptionsResponse response) { return new ListTopicSubscriptionsPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + @Nullable + PageContext + context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } @@ -1857,7 +1855,7 @@ public static class ListTopicSubscriptionsFixedSizeCollection ListTopicSubscriptionsFixedSizeCollection> { private ListTopicSubscriptionsFixedSizeCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { super(pages, collectionSize); } @@ -1867,7 +1865,7 @@ private static ListTopicSubscriptionsFixedSizeCollection createEmptyCollection() @Override protected ListTopicSubscriptionsFixedSizeCollection createCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { return new ListTopicSubscriptionsFixedSizeCollection(pages, collectionSize); } } @@ -1901,8 +1899,9 @@ public static class ListTopicSnapshotsPage ListTopicSnapshotsRequest, ListTopicSnapshotsResponse, String, ListTopicSnapshotsPage> { private ListTopicSnapshotsPage( - PageContext context, - ListTopicSnapshotsResponse response) { + @Nullable + PageContext context, + @Nullable ListTopicSnapshotsResponse response) { super(context, response); } @@ -1912,14 +1911,16 @@ private static ListTopicSnapshotsPage createEmptyPage() { @Override protected ListTopicSnapshotsPage createPage( - PageContext context, - ListTopicSnapshotsResponse response) { + @Nullable + PageContext context, + @Nullable ListTopicSnapshotsResponse response) { return new ListTopicSnapshotsPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + @Nullable + PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } @@ -1934,7 +1935,7 @@ public static class ListTopicSnapshotsFixedSizeCollection ListTopicSnapshotsFixedSizeCollection> { private ListTopicSnapshotsFixedSizeCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { super(pages, collectionSize); } @@ -1944,7 +1945,7 @@ private static ListTopicSnapshotsFixedSizeCollection createEmptyCollection() { @Override protected ListTopicSnapshotsFixedSizeCollection createCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { return new ListTopicSnapshotsFixedSizeCollection(pages, collectionSize); } } diff --git a/sdk-platform-java/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/TopicAdminSettings.java b/sdk-platform-java/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/TopicAdminSettings.java index 3cd5c31abad1..492c445f938c 100644 --- a/sdk-platform-java/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/TopicAdminSettings.java +++ b/sdk-platform-java/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/TopicAdminSettings.java @@ -57,6 +57,7 @@ import java.util.List; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -223,7 +224,7 @@ public static Builder newBuilder() { } /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { + public static Builder newBuilder(@Nullable ClientContext clientContext) { return new Builder(clientContext); } @@ -243,7 +244,7 @@ protected Builder() throws IOException { this(((ClientContext) null)); } - protected Builder(ClientContext clientContext) { + protected Builder(@Nullable ClientContext clientContext) { super(PublisherStubSettings.newBuilder(clientContext)); } diff --git a/sdk-platform-java/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/PublisherStubSettings.java b/sdk-platform-java/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/PublisherStubSettings.java index 30709fd96c19..1b8c7f41b7c0 100644 --- a/sdk-platform-java/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/PublisherStubSettings.java +++ b/sdk-platform-java/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/PublisherStubSettings.java @@ -82,6 +82,7 @@ import java.util.List; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -540,7 +541,7 @@ public static Builder newBuilder() { } /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { + public static Builder newBuilder(@Nullable ClientContext clientContext) { return new Builder(clientContext); } @@ -669,7 +670,7 @@ protected Builder() { this(((ClientContext) null)); } - protected Builder(ClientContext clientContext) { + protected Builder(@Nullable ClientContext clientContext) { super(clientContext); createTopicSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); diff --git a/sdk-platform-java/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/SchemaServiceStubSettings.java b/sdk-platform-java/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/SchemaServiceStubSettings.java index 4871f04a3607..85401696e63e 100644 --- a/sdk-platform-java/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/SchemaServiceStubSettings.java +++ b/sdk-platform-java/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/SchemaServiceStubSettings.java @@ -71,6 +71,7 @@ import java.util.List; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -402,7 +403,7 @@ public static Builder newBuilder() { } /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { + public static Builder newBuilder(@Nullable ClientContext clientContext) { return new Builder(clientContext); } @@ -484,7 +485,7 @@ protected Builder() { this(((ClientContext) null)); } - protected Builder(ClientContext clientContext) { + protected Builder(@Nullable ClientContext clientContext) { super(clientContext); createSchemaSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); diff --git a/sdk-platform-java/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/SubscriberStubSettings.java b/sdk-platform-java/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/SubscriberStubSettings.java index 394af9a144ff..10882d908434 100644 --- a/sdk-platform-java/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/SubscriberStubSettings.java +++ b/sdk-platform-java/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/SubscriberStubSettings.java @@ -80,6 +80,7 @@ import java.util.List; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -448,7 +449,7 @@ public static Builder newBuilder() { } /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { + public static Builder newBuilder(@Nullable ClientContext clientContext) { return new Builder(clientContext); } @@ -590,7 +591,7 @@ protected Builder() { this(((ClientContext) null)); } - protected Builder(ClientContext clientContext) { + protected Builder(@Nullable ClientContext clientContext) { super(clientContext); createSubscriptionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); diff --git a/sdk-platform-java/test/integration/goldens/pubsub/src/com/google/pubsub/v1/ProjectName.java b/sdk-platform-java/test/integration/goldens/pubsub/src/com/google/pubsub/v1/ProjectName.java index 2db74834b0de..bb2978c9c2c8 100644 --- a/sdk-platform-java/test/integration/goldens/pubsub/src/com/google/pubsub/v1/ProjectName.java +++ b/sdk-platform-java/test/integration/goldens/pubsub/src/com/google/pubsub/v1/ProjectName.java @@ -26,6 +26,7 @@ import java.util.Objects; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. @NullMarked @@ -65,6 +66,7 @@ public static String format(String project) { return newBuilder().setProject(project).build().toString(); } + @Nullable public static ProjectName parse(String formattedString) { if (formattedString.isEmpty()) { return null; @@ -83,7 +85,7 @@ public static List parseList(List formattedStrings) { return list; } - public static List toStringList(List values) { + public static List toStringList(List<@Nullable ProjectName> values) { List list = new ArrayList<>(values.size()); for (ProjectName value : values) { if (value == null) { @@ -125,7 +127,7 @@ public String toString() { } @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (o == this) { return true; } diff --git a/sdk-platform-java/test/integration/goldens/pubsub/src/com/google/pubsub/v1/SchemaName.java b/sdk-platform-java/test/integration/goldens/pubsub/src/com/google/pubsub/v1/SchemaName.java index a7fcd22be396..b5442e7844c7 100644 --- a/sdk-platform-java/test/integration/goldens/pubsub/src/com/google/pubsub/v1/SchemaName.java +++ b/sdk-platform-java/test/integration/goldens/pubsub/src/com/google/pubsub/v1/SchemaName.java @@ -26,6 +26,7 @@ import java.util.Objects; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. @NullMarked @@ -72,6 +73,7 @@ public static String format(String project, String schema) { return newBuilder().setProject(project).setSchema(schema).build().toString(); } + @Nullable public static SchemaName parse(String formattedString) { if (formattedString.isEmpty()) { return null; @@ -90,7 +92,7 @@ public static List parseList(List formattedStrings) { return list; } - public static List toStringList(List values) { + public static List toStringList(List<@Nullable SchemaName> values) { List list = new ArrayList<>(values.size()); for (SchemaName value : values) { if (value == null) { @@ -135,7 +137,7 @@ public String toString() { } @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (o == this) { return true; } diff --git a/sdk-platform-java/test/integration/goldens/pubsub/src/com/google/pubsub/v1/SnapshotName.java b/sdk-platform-java/test/integration/goldens/pubsub/src/com/google/pubsub/v1/SnapshotName.java index bbeafc6c4ddb..4496e948c40a 100644 --- a/sdk-platform-java/test/integration/goldens/pubsub/src/com/google/pubsub/v1/SnapshotName.java +++ b/sdk-platform-java/test/integration/goldens/pubsub/src/com/google/pubsub/v1/SnapshotName.java @@ -26,6 +26,7 @@ import java.util.Objects; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. @NullMarked @@ -72,6 +73,7 @@ public static String format(String project, String snapshot) { return newBuilder().setProject(project).setSnapshot(snapshot).build().toString(); } + @Nullable public static SnapshotName parse(String formattedString) { if (formattedString.isEmpty()) { return null; @@ -90,7 +92,7 @@ public static List parseList(List formattedStrings) { return list; } - public static List toStringList(List values) { + public static List toStringList(List<@Nullable SnapshotName> values) { List list = new ArrayList<>(values.size()); for (SnapshotName value : values) { if (value == null) { @@ -135,7 +137,7 @@ public String toString() { } @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (o == this) { return true; } diff --git a/sdk-platform-java/test/integration/goldens/pubsub/src/com/google/pubsub/v1/SubscriptionName.java b/sdk-platform-java/test/integration/goldens/pubsub/src/com/google/pubsub/v1/SubscriptionName.java index 8ea245778aab..1160e969567e 100644 --- a/sdk-platform-java/test/integration/goldens/pubsub/src/com/google/pubsub/v1/SubscriptionName.java +++ b/sdk-platform-java/test/integration/goldens/pubsub/src/com/google/pubsub/v1/SubscriptionName.java @@ -26,6 +26,7 @@ import java.util.Objects; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. @NullMarked @@ -72,6 +73,7 @@ public static String format(String project, String subscription) { return newBuilder().setProject(project).setSubscription(subscription).build().toString(); } + @Nullable public static SubscriptionName parse(String formattedString) { if (formattedString.isEmpty()) { return null; @@ -90,7 +92,7 @@ public static List parseList(List formattedStrings) { return list; } - public static List toStringList(List values) { + public static List toStringList(List<@Nullable SubscriptionName> values) { List list = new ArrayList<>(values.size()); for (SubscriptionName value : values) { if (value == null) { @@ -135,7 +137,7 @@ public String toString() { } @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (o == this) { return true; } diff --git a/sdk-platform-java/test/integration/goldens/pubsub/src/com/google/pubsub/v1/TopicName.java b/sdk-platform-java/test/integration/goldens/pubsub/src/com/google/pubsub/v1/TopicName.java index 5aa9b579ffbc..c6560044f0f5 100644 --- a/sdk-platform-java/test/integration/goldens/pubsub/src/com/google/pubsub/v1/TopicName.java +++ b/sdk-platform-java/test/integration/goldens/pubsub/src/com/google/pubsub/v1/TopicName.java @@ -27,6 +27,7 @@ import java.util.Objects; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. @NullMarked @@ -104,6 +105,7 @@ public static String formatDeletedTopicName() { return "_deleted-topic_"; } + @Nullable public static TopicName parse(String formattedString) { if (formattedString.isEmpty()) { return null; @@ -125,7 +127,7 @@ public static List parseList(List formattedStrings) { return list; } - public static List toStringList(List values) { + public static List toStringList(List<@Nullable TopicName> values) { List list = new ArrayList<>(values.size()); for (TopicName value : values) { if (value == null) { @@ -170,7 +172,7 @@ public String toString() { } @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (o == this) { return true; } diff --git a/sdk-platform-java/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/CloudRedisClient.java b/sdk-platform-java/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/CloudRedisClient.java index abbea298e8e9..5d06128951c5 100644 --- a/sdk-platform-java/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/CloudRedisClient.java +++ b/sdk-platform-java/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/CloudRedisClient.java @@ -41,6 +41,7 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -376,7 +377,7 @@ @BetaApi @Generated("by gapic-generator-java") public class CloudRedisClient implements BackgroundResource { - private final CloudRedisSettings settings; + @Nullable private final CloudRedisSettings settings; private final CloudRedisStub stub; private final OperationsClient httpJsonOperationsClient; private final com.google.longrunning.OperationsClient operationsClient; @@ -422,6 +423,7 @@ protected CloudRedisClient(CloudRedisStub stub) { this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); } + @Nullable public final CloudRedisSettings getSettings() { return settings; } @@ -483,9 +485,7 @@ public final OperationsClient getHttpJsonOperationsClient() { */ public final ListInstancesPagedResponse listInstances(LocationName parent) { ListInstancesRequest request = - ListInstancesRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .build(); + ListInstancesRequest.newBuilder().setParent(parent.toString()).build(); return listInstances(request); } @@ -685,8 +685,7 @@ public final UnaryCallable listInst * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Instance getInstance(InstanceName name) { - GetInstanceRequest request = - GetInstanceRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + GetInstanceRequest request = GetInstanceRequest.newBuilder().setName(name.toString()).build(); return getInstance(request); } @@ -799,9 +798,7 @@ public final UnaryCallable getInstanceCallable() { */ public final InstanceAuthString getInstanceAuthString(InstanceName name) { GetInstanceAuthStringRequest request = - GetInstanceAuthStringRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .build(); + GetInstanceAuthStringRequest.newBuilder().setName(name.toString()).build(); return getInstanceAuthString(request); } @@ -944,7 +941,7 @@ public final OperationFuture createInstanceAsync( LocationName parent, String instanceId, Instance instance) { CreateInstanceRequest request = CreateInstanceRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) + .setParent(parent.toString()) .setInstanceId(instanceId) .setInstance(instance) .build(); @@ -1297,7 +1294,7 @@ public final OperationFuture upgradeInstanceAsync( InstanceName name, String redisVersion) { UpgradeInstanceRequest request = UpgradeInstanceRequest.newBuilder() - .setName(name == null ? null : name.toString()) + .setName(name.toString()) .setRedisVersion(redisVersion) .build(); return upgradeInstanceAsync(request); @@ -1736,7 +1733,7 @@ public final OperationFuture failoverInstanceAsync( InstanceName name, FailoverInstanceRequest.DataProtectionMode dataProtectionMode) { FailoverInstanceRequest request = FailoverInstanceRequest.newBuilder() - .setName(name == null ? null : name.toString()) + .setName(name.toString()) .setDataProtectionMode(dataProtectionMode) .build(); return failoverInstanceAsync(request); @@ -1893,7 +1890,7 @@ public final UnaryCallable failoverInstanceC */ public final OperationFuture deleteInstanceAsync(InstanceName name) { DeleteInstanceRequest request = - DeleteInstanceRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + DeleteInstanceRequest.newBuilder().setName(name.toString()).build(); return deleteInstanceAsync(request); } @@ -2046,7 +2043,7 @@ public final OperationFuture rescheduleMaintenanceAsync( Timestamp scheduleTime) { RescheduleMaintenanceRequest request = RescheduleMaintenanceRequest.newBuilder() - .setName(name == null ? null : name.toString()) + .setName(name.toString()) .setRescheduleType(rescheduleType) .setScheduleTime(scheduleTime) .build(); @@ -2246,8 +2243,8 @@ public static class ListInstancesPage ListInstancesRequest, ListInstancesResponse, Instance, ListInstancesPage> { private ListInstancesPage( - PageContext context, - ListInstancesResponse response) { + @Nullable PageContext context, + @Nullable ListInstancesResponse response) { super(context, response); } @@ -2257,14 +2254,14 @@ private static ListInstancesPage createEmptyPage() { @Override protected ListInstancesPage createPage( - PageContext context, - ListInstancesResponse response) { + @Nullable PageContext context, + @Nullable ListInstancesResponse response) { return new ListInstancesPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + @Nullable PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } @@ -2278,7 +2275,8 @@ public static class ListInstancesFixedSizeCollection ListInstancesPage, ListInstancesFixedSizeCollection> { - private ListInstancesFixedSizeCollection(List pages, int collectionSize) { + private ListInstancesFixedSizeCollection( + @Nullable List pages, int collectionSize) { super(pages, collectionSize); } @@ -2288,7 +2286,7 @@ private static ListInstancesFixedSizeCollection createEmptyCollection() { @Override protected ListInstancesFixedSizeCollection createCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { return new ListInstancesFixedSizeCollection(pages, collectionSize); } } diff --git a/sdk-platform-java/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/CloudRedisSettings.java b/sdk-platform-java/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/CloudRedisSettings.java index da404eee4abc..a0af89221248 100644 --- a/sdk-platform-java/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/CloudRedisSettings.java +++ b/sdk-platform-java/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/CloudRedisSettings.java @@ -40,6 +40,7 @@ import java.util.List; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -281,7 +282,7 @@ public static Builder newHttpJsonBuilder() { } /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { + public static Builder newBuilder(@Nullable ClientContext clientContext) { return new Builder(clientContext); } @@ -301,7 +302,7 @@ protected Builder() throws IOException { this(((ClientContext) null)); } - protected Builder(ClientContext clientContext) { + protected Builder(@Nullable ClientContext clientContext) { super(CloudRedisStubSettings.newBuilder(clientContext)); } diff --git a/sdk-platform-java/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/InstanceName.java b/sdk-platform-java/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/InstanceName.java index 603b9f8ca7ef..ec160ede18c0 100644 --- a/sdk-platform-java/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/InstanceName.java +++ b/sdk-platform-java/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/InstanceName.java @@ -26,6 +26,7 @@ import java.util.Objects; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. @NullMarked @@ -85,6 +86,7 @@ public static String format(String project, String location, String instance) { .toString(); } + @Nullable public static InstanceName parse(String formattedString) { if (formattedString.isEmpty()) { return null; @@ -103,7 +105,7 @@ public static List parseList(List formattedStrings) { return list; } - public static List toStringList(List values) { + public static List toStringList(List<@Nullable InstanceName> values) { List list = new ArrayList<>(values.size()); for (InstanceName value : values) { if (value == null) { @@ -152,7 +154,7 @@ public String toString() { } @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (o == this) { return true; } diff --git a/sdk-platform-java/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/LocationName.java b/sdk-platform-java/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/LocationName.java index 6b5c2f14a01f..56e3f550dfcc 100644 --- a/sdk-platform-java/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/LocationName.java +++ b/sdk-platform-java/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/LocationName.java @@ -26,6 +26,7 @@ import java.util.Objects; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. @NullMarked @@ -72,6 +73,7 @@ public static String format(String project, String location) { return newBuilder().setProject(project).setLocation(location).build().toString(); } + @Nullable public static LocationName parse(String formattedString) { if (formattedString.isEmpty()) { return null; @@ -90,7 +92,7 @@ public static List parseList(List formattedStrings) { return list; } - public static List toStringList(List values) { + public static List toStringList(List<@Nullable LocationName> values) { List list = new ArrayList<>(values.size()); for (LocationName value : values) { if (value == null) { @@ -135,7 +137,7 @@ public String toString() { } @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (o == this) { return true; } diff --git a/sdk-platform-java/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/stub/CloudRedisStub.java b/sdk-platform-java/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/stub/CloudRedisStub.java index e68811a95d94..7bd0b3e49971 100644 --- a/sdk-platform-java/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/stub/CloudRedisStub.java +++ b/sdk-platform-java/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/stub/CloudRedisStub.java @@ -42,6 +42,7 @@ import com.google.protobuf.Empty; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -54,11 +55,12 @@ @Generated("by gapic-generator-java") public abstract class CloudRedisStub implements BackgroundResource { - public OperationsStub getOperationsStub() { + public @Nullable OperationsStub getOperationsStub() { return null; } - public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() { + public com.google.api.gax.httpjson.longrunning.stub.@Nullable OperationsStub + getHttpJsonOperationsStub() { return null; } diff --git a/sdk-platform-java/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/stub/CloudRedisStubSettings.java b/sdk-platform-java/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/stub/CloudRedisStubSettings.java index c196c6066f9a..896e7ab51577 100644 --- a/sdk-platform-java/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/stub/CloudRedisStubSettings.java +++ b/sdk-platform-java/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/stub/CloudRedisStubSettings.java @@ -75,6 +75,7 @@ import java.util.List; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -447,7 +448,7 @@ public static Builder newHttpJsonBuilder() { } /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { + public static Builder newBuilder(@Nullable ClientContext clientContext) { return new Builder(clientContext); } @@ -561,7 +562,7 @@ protected Builder() { this(((ClientContext) null)); } - protected Builder(ClientContext clientContext) { + protected Builder(@Nullable ClientContext clientContext) { super(clientContext); listInstancesSettings = PagedCallSettings.newBuilder(LIST_INSTANCES_PAGE_STR_FACT); diff --git a/sdk-platform-java/test/integration/goldens/storage/src/com/google/storage/v2/BucketName.java b/sdk-platform-java/test/integration/goldens/storage/src/com/google/storage/v2/BucketName.java index 64f36d73175a..5bc323f99f4d 100644 --- a/sdk-platform-java/test/integration/goldens/storage/src/com/google/storage/v2/BucketName.java +++ b/sdk-platform-java/test/integration/goldens/storage/src/com/google/storage/v2/BucketName.java @@ -26,6 +26,7 @@ import java.util.Objects; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. @NullMarked @@ -72,6 +73,7 @@ public static String format(String project, String bucket) { return newBuilder().setProject(project).setBucket(bucket).build().toString(); } + @Nullable public static BucketName parse(String formattedString) { if (formattedString.isEmpty()) { return null; @@ -90,7 +92,7 @@ public static List parseList(List formattedStrings) { return list; } - public static List toStringList(List values) { + public static List toStringList(List<@Nullable BucketName> values) { List list = new ArrayList<>(values.size()); for (BucketName value : values) { if (value == null) { @@ -135,7 +137,7 @@ public String toString() { } @Override - public boolean equals(java.lang.Object o) { + public boolean equals(java.lang.@Nullable Object o) { if (o == this) { return true; } diff --git a/sdk-platform-java/test/integration/goldens/storage/src/com/google/storage/v2/CryptoKeyName.java b/sdk-platform-java/test/integration/goldens/storage/src/com/google/storage/v2/CryptoKeyName.java index b9ccbab4b6fa..26810e7405fb 100644 --- a/sdk-platform-java/test/integration/goldens/storage/src/com/google/storage/v2/CryptoKeyName.java +++ b/sdk-platform-java/test/integration/goldens/storage/src/com/google/storage/v2/CryptoKeyName.java @@ -26,6 +26,7 @@ import java.util.Objects; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. @NullMarked @@ -99,6 +100,7 @@ public static String format(String project, String location, String keyRing, Str .toString(); } + @Nullable public static CryptoKeyName parse(String formattedString) { if (formattedString.isEmpty()) { return null; @@ -121,7 +123,7 @@ public static List parseList(List formattedStrings) { return list; } - public static List toStringList(List values) { + public static List toStringList(List<@Nullable CryptoKeyName> values) { List list = new ArrayList<>(values.size()); for (CryptoKeyName value : values) { if (value == null) { @@ -173,7 +175,7 @@ public String toString() { } @Override - public boolean equals(java.lang.Object o) { + public boolean equals(java.lang.@Nullable Object o) { if (o == this) { return true; } diff --git a/sdk-platform-java/test/integration/goldens/storage/src/com/google/storage/v2/NotificationName.java b/sdk-platform-java/test/integration/goldens/storage/src/com/google/storage/v2/NotificationName.java index 5e33a2ad301e..2fee01961152 100644 --- a/sdk-platform-java/test/integration/goldens/storage/src/com/google/storage/v2/NotificationName.java +++ b/sdk-platform-java/test/integration/goldens/storage/src/com/google/storage/v2/NotificationName.java @@ -26,6 +26,7 @@ import java.util.Objects; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. @NullMarked @@ -85,6 +86,7 @@ public static String format(String project, String bucket, String notification) .toString(); } + @Nullable public static NotificationName parse(String formattedString) { if (formattedString.isEmpty()) { return null; @@ -103,7 +105,7 @@ public static List parseList(List formattedStrings) { return list; } - public static List toStringList(List values) { + public static List toStringList(List<@Nullable NotificationName> values) { List list = new ArrayList<>(values.size()); for (NotificationName value : values) { if (value == null) { @@ -152,7 +154,7 @@ public String toString() { } @Override - public boolean equals(java.lang.Object o) { + public boolean equals(java.lang.@Nullable Object o) { if (o == this) { return true; } diff --git a/sdk-platform-java/test/integration/goldens/storage/src/com/google/storage/v2/ProjectName.java b/sdk-platform-java/test/integration/goldens/storage/src/com/google/storage/v2/ProjectName.java index 790851e53aa8..057f62f543b6 100644 --- a/sdk-platform-java/test/integration/goldens/storage/src/com/google/storage/v2/ProjectName.java +++ b/sdk-platform-java/test/integration/goldens/storage/src/com/google/storage/v2/ProjectName.java @@ -26,6 +26,7 @@ import java.util.Objects; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. @NullMarked @@ -65,6 +66,7 @@ public static String format(String project) { return newBuilder().setProject(project).build().toString(); } + @Nullable public static ProjectName parse(String formattedString) { if (formattedString.isEmpty()) { return null; @@ -83,7 +85,7 @@ public static List parseList(List formattedStrings) { return list; } - public static List toStringList(List values) { + public static List toStringList(List<@Nullable ProjectName> values) { List list = new ArrayList<>(values.size()); for (ProjectName value : values) { if (value == null) { @@ -125,7 +127,7 @@ public String toString() { } @Override - public boolean equals(java.lang.Object o) { + public boolean equals(java.lang.@Nullable Object o) { if (o == this) { return true; } diff --git a/sdk-platform-java/test/integration/goldens/storage/src/com/google/storage/v2/StorageClient.java b/sdk-platform-java/test/integration/goldens/storage/src/com/google/storage/v2/StorageClient.java index 38af59ac85e2..8b827ec8423a 100644 --- a/sdk-platform-java/test/integration/goldens/storage/src/com/google/storage/v2/StorageClient.java +++ b/sdk-platform-java/test/integration/goldens/storage/src/com/google/storage/v2/StorageClient.java @@ -42,6 +42,7 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -671,7 +672,7 @@ @NullMarked @Generated("by gapic-generator-java") public class StorageClient implements BackgroundResource { - private final StorageSettings settings; + @Nullable private final StorageSettings settings; private final StorageStub stub; /** Constructs an instance of StorageClient with default settings. */ @@ -709,6 +710,7 @@ protected StorageClient(StorageStub stub) { this.stub = stub; } + @Nullable public final StorageSettings getSettings() { return settings; } @@ -739,8 +741,7 @@ public StorageStub getStub() { * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final void deleteBucket(BucketName name) { - DeleteBucketRequest request = - DeleteBucketRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + DeleteBucketRequest request = DeleteBucketRequest.newBuilder().setName(name.toString()).build(); deleteBucket(request); } @@ -851,8 +852,7 @@ public final UnaryCallable deleteBucketCallable() { * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Bucket getBucket(BucketName name) { - GetBucketRequest request = - GetBucketRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + GetBucketRequest request = GetBucketRequest.newBuilder().setName(name.toString()).build(); return getBucket(request); } @@ -975,7 +975,7 @@ public final UnaryCallable getBucketCallable() { public final Bucket createBucket(ProjectName parent, Bucket bucket, String bucketId) { CreateBucketRequest request = CreateBucketRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) + .setParent(parent.toString()) .setBucket(bucket) .setBucketId(bucketId) .build(); @@ -1109,9 +1109,7 @@ public final UnaryCallable createBucketCallable() { */ public final ListBucketsPagedResponse listBuckets(ProjectName parent) { ListBucketsRequest request = - ListBucketsRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .build(); + ListBucketsRequest.newBuilder().setParent(parent.toString()).build(); return listBuckets(request); } @@ -1274,9 +1272,7 @@ public final UnaryCallable listBucketsC */ public final Bucket lockBucketRetentionPolicy(BucketName bucket) { LockBucketRetentionPolicyRequest request = - LockBucketRetentionPolicyRequest.newBuilder() - .setBucket(bucket == null ? null : bucket.toString()) - .build(); + LockBucketRetentionPolicyRequest.newBuilder().setBucket(bucket.toString()).build(); return lockBucketRetentionPolicy(request); } @@ -1393,9 +1389,7 @@ public final Bucket lockBucketRetentionPolicy(LockBucketRetentionPolicyRequest r */ public final Policy getIamPolicy(ResourceName resource) { GetIamPolicyRequest request = - GetIamPolicyRequest.newBuilder() - .setResource(resource == null ? null : resource.toString()) - .build(); + GetIamPolicyRequest.newBuilder().setResource(resource.toString()).build(); return getIamPolicy(request); } @@ -1525,10 +1519,7 @@ public final UnaryCallable getIamPolicyCallable() { */ public final Policy setIamPolicy(ResourceName resource, Policy policy) { SetIamPolicyRequest request = - SetIamPolicyRequest.newBuilder() - .setResource(resource == null ? null : resource.toString()) - .setPolicy(policy) - .build(); + SetIamPolicyRequest.newBuilder().setResource(resource.toString()).setPolicy(policy).build(); return setIamPolicy(request); } @@ -1668,7 +1659,7 @@ public final TestIamPermissionsResponse testIamPermissions( ResourceName resource, List permissions) { TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder() - .setResource(resource == null ? null : resource.toString()) + .setResource(resource.toString()) .addAllPermissions(permissions) .build(); return testIamPermissions(request); @@ -1907,9 +1898,7 @@ public final UnaryCallable updateBucketCallable() { */ public final void deleteNotification(NotificationName name) { DeleteNotificationRequest request = - DeleteNotificationRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .build(); + DeleteNotificationRequest.newBuilder().setName(name.toString()).build(); deleteNotification(request); } @@ -2019,7 +2008,7 @@ public final UnaryCallable deleteNotificationC */ public final Notification getNotification(BucketName name) { GetNotificationRequest request = - GetNotificationRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + GetNotificationRequest.newBuilder().setName(name.toString()).build(); return getNotification(request); } @@ -2133,7 +2122,7 @@ public final UnaryCallable getNotification public final Notification createNotification(ProjectName parent, Notification notification) { CreateNotificationRequest request = CreateNotificationRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) + .setParent(parent.toString()) .setNotification(notification) .build(); return createNotification(request); @@ -2260,9 +2249,7 @@ public final UnaryCallable createNotifi */ public final ListNotificationsPagedResponse listNotifications(ProjectName parent) { ListNotificationsRequest request = - ListNotificationsRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .build(); + ListNotificationsRequest.newBuilder().setParent(parent.toString()).build(); return listNotifications(request); } @@ -3088,9 +3075,7 @@ public final UnaryCallable updateObjectCallable() { */ public final ListObjectsPagedResponse listObjects(ProjectName parent) { ListObjectsRequest request = - ListObjectsRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .build(); + ListObjectsRequest.newBuilder().setParent(parent.toString()).build(); return listObjects(request); } @@ -3552,9 +3537,7 @@ public final QueryWriteStatusResponse queryWriteStatus(QueryWriteStatusRequest r */ public final ServiceAccount getServiceAccount(ProjectName project) { GetServiceAccountRequest request = - GetServiceAccountRequest.newBuilder() - .setProject(project == null ? null : project.toString()) - .build(); + GetServiceAccountRequest.newBuilder().setProject(project.toString()).build(); return getServiceAccount(request); } @@ -3671,7 +3654,7 @@ public final CreateHmacKeyResponse createHmacKey( ProjectName project, String serviceAccountEmail) { CreateHmacKeyRequest request = CreateHmacKeyRequest.newBuilder() - .setProject(project == null ? null : project.toString()) + .setProject(project.toString()) .setServiceAccountEmail(serviceAccountEmail) .build(); return createHmacKey(request); @@ -3798,7 +3781,7 @@ public final void deleteHmacKey(String accessId, ProjectName project) { DeleteHmacKeyRequest request = DeleteHmacKeyRequest.newBuilder() .setAccessId(accessId) - .setProject(project == null ? null : project.toString()) + .setProject(project.toString()) .build(); deleteHmacKey(request); } @@ -3918,10 +3901,7 @@ public final UnaryCallable deleteHmacKeyCallable() */ public final HmacKeyMetadata getHmacKey(String accessId, ProjectName project) { GetHmacKeyRequest request = - GetHmacKeyRequest.newBuilder() - .setAccessId(accessId) - .setProject(project == null ? null : project.toString()) - .build(); + GetHmacKeyRequest.newBuilder().setAccessId(accessId).setProject(project.toString()).build(); return getHmacKey(request); } @@ -4040,9 +4020,7 @@ public final UnaryCallable getHmacKeyCallabl */ public final ListHmacKeysPagedResponse listHmacKeys(ProjectName project) { ListHmacKeysRequest request = - ListHmacKeysRequest.newBuilder() - .setProject(project == null ? null : project.toString()) - .build(); + ListHmacKeysRequest.newBuilder().setProject(project.toString()).build(); return listHmacKeys(request); } @@ -4330,8 +4308,8 @@ public static class ListBucketsPage extends AbstractPage { private ListBucketsPage( - PageContext context, - ListBucketsResponse response) { + @Nullable PageContext context, + @Nullable ListBucketsResponse response) { super(context, response); } @@ -4341,14 +4319,14 @@ private static ListBucketsPage createEmptyPage() { @Override protected ListBucketsPage createPage( - PageContext context, - ListBucketsResponse response) { + @Nullable PageContext context, + @Nullable ListBucketsResponse response) { return new ListBucketsPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + @Nullable PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } @@ -4362,7 +4340,8 @@ public static class ListBucketsFixedSizeCollection ListBucketsPage, ListBucketsFixedSizeCollection> { - private ListBucketsFixedSizeCollection(List pages, int collectionSize) { + private ListBucketsFixedSizeCollection( + @Nullable List pages, int collectionSize) { super(pages, collectionSize); } @@ -4372,7 +4351,7 @@ private static ListBucketsFixedSizeCollection createEmptyCollection() { @Override protected ListBucketsFixedSizeCollection createCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { return new ListBucketsFixedSizeCollection(pages, collectionSize); } } @@ -4409,8 +4388,9 @@ public static class ListNotificationsPage ListNotificationsPage> { private ListNotificationsPage( - PageContext context, - ListNotificationsResponse response) { + @Nullable + PageContext context, + @Nullable ListNotificationsResponse response) { super(context, response); } @@ -4420,14 +4400,16 @@ private static ListNotificationsPage createEmptyPage() { @Override protected ListNotificationsPage createPage( - PageContext context, - ListNotificationsResponse response) { + @Nullable + PageContext context, + @Nullable ListNotificationsResponse response) { return new ListNotificationsPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + @Nullable + PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } @@ -4442,7 +4424,7 @@ public static class ListNotificationsFixedSizeCollection ListNotificationsFixedSizeCollection> { private ListNotificationsFixedSizeCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { super(pages, collectionSize); } @@ -4452,7 +4434,7 @@ private static ListNotificationsFixedSizeCollection createEmptyCollection() { @Override protected ListNotificationsFixedSizeCollection createCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { return new ListNotificationsFixedSizeCollection(pages, collectionSize); } } @@ -4483,8 +4465,8 @@ public static class ListObjectsPage extends AbstractPage { private ListObjectsPage( - PageContext context, - ListObjectsResponse response) { + @Nullable PageContext context, + @Nullable ListObjectsResponse response) { super(context, response); } @@ -4494,14 +4476,14 @@ private static ListObjectsPage createEmptyPage() { @Override protected ListObjectsPage createPage( - PageContext context, - ListObjectsResponse response) { + @Nullable PageContext context, + @Nullable ListObjectsResponse response) { return new ListObjectsPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + @Nullable PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } @@ -4515,7 +4497,8 @@ public static class ListObjectsFixedSizeCollection ListObjectsPage, ListObjectsFixedSizeCollection> { - private ListObjectsFixedSizeCollection(List pages, int collectionSize) { + private ListObjectsFixedSizeCollection( + @Nullable List pages, int collectionSize) { super(pages, collectionSize); } @@ -4525,7 +4508,7 @@ private static ListObjectsFixedSizeCollection createEmptyCollection() { @Override protected ListObjectsFixedSizeCollection createCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { return new ListObjectsFixedSizeCollection(pages, collectionSize); } } @@ -4559,8 +4542,8 @@ public static class ListHmacKeysPage ListHmacKeysRequest, ListHmacKeysResponse, HmacKeyMetadata, ListHmacKeysPage> { private ListHmacKeysPage( - PageContext context, - ListHmacKeysResponse response) { + @Nullable PageContext context, + @Nullable ListHmacKeysResponse response) { super(context, response); } @@ -4570,14 +4553,14 @@ private static ListHmacKeysPage createEmptyPage() { @Override protected ListHmacKeysPage createPage( - PageContext context, - ListHmacKeysResponse response) { + @Nullable PageContext context, + @Nullable ListHmacKeysResponse response) { return new ListHmacKeysPage(context, response); } @Override public ApiFuture createPageAsync( - PageContext context, + @Nullable PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } @@ -4591,7 +4574,8 @@ public static class ListHmacKeysFixedSizeCollection ListHmacKeysPage, ListHmacKeysFixedSizeCollection> { - private ListHmacKeysFixedSizeCollection(List pages, int collectionSize) { + private ListHmacKeysFixedSizeCollection( + @Nullable List pages, int collectionSize) { super(pages, collectionSize); } @@ -4601,7 +4585,7 @@ private static ListHmacKeysFixedSizeCollection createEmptyCollection() { @Override protected ListHmacKeysFixedSizeCollection createCollection( - List pages, int collectionSize) { + @Nullable List pages, int collectionSize) { return new ListHmacKeysFixedSizeCollection(pages, collectionSize); } } diff --git a/sdk-platform-java/test/integration/goldens/storage/src/com/google/storage/v2/StorageSettings.java b/sdk-platform-java/test/integration/goldens/storage/src/com/google/storage/v2/StorageSettings.java index 14f6bcbea995..74b94b095c95 100644 --- a/sdk-platform-java/test/integration/goldens/storage/src/com/google/storage/v2/StorageSettings.java +++ b/sdk-platform-java/test/integration/goldens/storage/src/com/google/storage/v2/StorageSettings.java @@ -45,6 +45,7 @@ import java.util.List; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -302,7 +303,7 @@ public static Builder newBuilder() { } /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { + public static Builder newBuilder(@Nullable ClientContext clientContext) { return new Builder(clientContext); } @@ -322,7 +323,7 @@ protected Builder() throws IOException { this(((ClientContext) null)); } - protected Builder(ClientContext clientContext) { + protected Builder(@Nullable ClientContext clientContext) { super(StorageStubSettings.newBuilder(clientContext)); } diff --git a/sdk-platform-java/test/integration/goldens/storage/src/com/google/storage/v2/stub/StorageStubSettings.java b/sdk-platform-java/test/integration/goldens/storage/src/com/google/storage/v2/stub/StorageStubSettings.java index 83dd99d89c31..01a0e0f1a556 100644 --- a/sdk-platform-java/test/integration/goldens/storage/src/com/google/storage/v2/stub/StorageStubSettings.java +++ b/sdk-platform-java/test/integration/goldens/storage/src/com/google/storage/v2/stub/StorageStubSettings.java @@ -104,6 +104,7 @@ import java.util.List; import javax.annotation.Generated; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -655,7 +656,7 @@ public static Builder newBuilder() { } /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { + public static Builder newBuilder(@Nullable ClientContext clientContext) { return new Builder(clientContext); } @@ -797,7 +798,7 @@ protected Builder() { this(((ClientContext) null)); } - protected Builder(ClientContext clientContext) { + protected Builder(@Nullable ClientContext clientContext) { super(clientContext); deleteBucketSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();