@java.lang.Override public Builder newBuilderForType() { return newBuilder(); }
public Builder mergeFrom(com.google.bigtable.admin.v2.ListTablesRequest other) { if (other == com.google.bigtable.admin.v2.ListTablesRequest.getDefaultInstance()) return this; if (!other.getParent().isEmpty()) { parent_ = other.parent_; onChanged(); } if (other.view_ != 0) { setViewValue(other.getViewValue()); } if (other.getPageSize() != 0) { setPageSize(other.getPageSize()); } if (!other.getPageToken().isEmpty()) { pageToken_ = other.pageToken_; onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
@java.lang.Override public com.google.bigtable.admin.v2.ListTablesRequest buildPartial() { com.google.bigtable.admin.v2.ListTablesRequest result = new com.google.bigtable.admin.v2.ListTablesRequest(this); result.parent_ = parent_; result.view_ = view_; result.pageSize_ = pageSize_; result.pageToken_ = pageToken_; onBuilt(); return result; }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.bigtable.admin.v2.ListTablesRequest)) { return super.equals(obj); } com.google.bigtable.admin.v2.ListTablesRequest other = (com.google.bigtable.admin.v2.ListTablesRequest) obj; boolean result = true; result = result && getParent().equals(other.getParent()); result = result && view_ == other.view_; result = result && (getPageSize() == other.getPageSize()); result = result && getPageToken().equals(other.getPageToken()); result = result && unknownFields.equals(other.unknownFields); return result; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + PARENT_FIELD_NUMBER; hash = (53 * hash) + getParent().hashCode(); hash = (37 * hash) + VIEW_FIELD_NUMBER; hash = (53 * hash) + view_; hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; hash = (53 * hash) + getPageSize(); hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; hash = (53 * hash) + getPageToken().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
/** * * * <pre> * The value of `next_page_token` returned by a previous call. * </pre> * * <code>string page_token = 3;</code> */ public Builder clearPageToken() { pageToken_ = getDefaultInstance().getPageToken(); onChanged(); return this; } /**
/** * * * <pre> * The unique name of the instance for which tables should be listed. * Values are of the form `projects/<project>/instances/<instance>`. * </pre> * * <code>string parent = 1;</code> */ public Builder clearParent() { parent_ = getDefaultInstance().getParent(); onChanged(); return this; } /**
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + PARENT_FIELD_NUMBER; hash = (53 * hash) + getParent().hashCode(); hash = (37 * hash) + VIEW_FIELD_NUMBER; hash = (53 * hash) + view_; hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; hash = (53 * hash) + getPageToken().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@Override public Map<String, String> extract(ListTablesRequest request) { ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); params.put("parent", String.valueOf(request.getParent())); return params.build(); } })
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.bigtable.admin.v2.ListTablesRequest)) { return super.equals(obj); } com.google.bigtable.admin.v2.ListTablesRequest other = (com.google.bigtable.admin.v2.ListTablesRequest) obj; boolean result = true; result = result && getParent() .equals(other.getParent()); result = result && view_ == other.view_; result = result && getPageToken() .equals(other.getPageToken()); return result; }
@java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!getParentBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); } if (view_ != com.google.bigtable.admin.v2.Table.View.VIEW_UNSPECIFIED.getNumber()) { output.writeEnum(2, view_); } if (!getPageTokenBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); } if (pageSize_ != 0) { output.writeInt32(4, pageSize_); } unknownFields.writeTo(output); }
@java.lang.Override public com.google.bigtable.admin.v2.ListTablesRequest getDefaultInstanceForType() { return com.google.bigtable.admin.v2.ListTablesRequest.getDefaultInstance(); }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + PARENT_FIELD_NUMBER; hash = (53 * hash) + getParent().hashCode(); hash = (37 * hash) + VIEW_FIELD_NUMBER; hash = (53 * hash) + view_; hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; hash = (53 * hash) + getPageSize(); hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; hash = (53 * hash) + getPageToken().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
/** * <pre> * The unique name of the instance for which tables should be listed. * Values are of the form projects/<project>/instances/<instance> * </pre> * * <code>string parent = 1;</code> */ public Builder clearParent() { parent_ = getDefaultInstance().getParent(); onChanged(); return this; } /**
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.bigtable.admin.v2.ListTablesRequest)) { return super.equals(obj); } com.google.bigtable.admin.v2.ListTablesRequest other = (com.google.bigtable.admin.v2.ListTablesRequest) obj; boolean result = true; result = result && getParent().equals(other.getParent()); result = result && view_ == other.view_; result = result && (getPageSize() == other.getPageSize()); result = result && getPageToken().equals(other.getPageToken()); result = result && unknownFields.equals(other.unknownFields); return result; }
@Test @SuppressWarnings("all") public void listTablesTest() { String nextPageToken = ""; Table tablesElement = Table.newBuilder().build(); List<Table> tables = Arrays.asList(tablesElement); ListTablesResponse expectedResponse = ListTablesResponse.newBuilder() .setNextPageToken(nextPageToken) .addAllTables(tables) .build(); mockBigtableTableAdmin.addResponse(expectedResponse); InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]"); ListTablesPagedResponse pagedListResponse = client.listTables(parent); List<Table> resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); Assert.assertEquals(expectedResponse.getTablesList().get(0), resources.get(0)); List<GeneratedMessageV3> actualRequests = mockBigtableTableAdmin.getRequests(); Assert.assertEquals(1, actualRequests.size()); ListTablesRequest actualRequest = (ListTablesRequest) actualRequests.get(0); Assert.assertEquals(parent, InstanceName.parse(actualRequest.getParent())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
@java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (!getParentBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); } if (view_ != com.google.bigtable.admin.v2.Table.View.VIEW_UNSPECIFIED.getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, view_); } if (!getPageTokenBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); } if (pageSize_ != 0) { size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, pageSize_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; }
/** * <pre> * The value of `next_page_token` returned by a previous call. * </pre> * * <code>string page_token = 3;</code> */ public Builder clearPageToken() { pageToken_ = getDefaultInstance().getPageToken(); onChanged(); return this; } /**
.setRequestMarshaller( io.grpc.protobuf.ProtoUtils.marshaller( com.google.bigtable.admin.v2.ListTablesRequest.getDefaultInstance())) .setResponseMarshaller( io.grpc.protobuf.ProtoUtils.marshaller(
@Override public ListTablesRequest injectToken(ListTablesRequest payload, String token) { return ListTablesRequest.newBuilder(payload).setPageToken(token).build(); }