@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.pubsub.v1.ListTopicsRequest)) { return super.equals(obj); } com.google.pubsub.v1.ListTopicsRequest other = (com.google.pubsub.v1.ListTopicsRequest) obj; boolean result = true; result = result && getProject().equals(other.getProject()); 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) + PROJECT_FIELD_NUMBER; hash = (53 * hash) + getProject().hashCode(); 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 name of the project in which to list topics. * Format is `projects/{project-id}`. * </pre> * * <code>string project = 1;</code> */ public Builder clearProject() { project_ = getDefaultInstance().getProject(); onChanged(); return this; } /**
public Builder mergeFrom(com.google.pubsub.v1.ListTopicsRequest other) { if (other == com.google.pubsub.v1.ListTopicsRequest.getDefaultInstance()) return this; if (!other.getProject().isEmpty()) { project_ = other.project_; onChanged(); } if (other.getPageSize() != 0) { setPageSize(other.getPageSize()); } if (!other.getPageToken().isEmpty()) { pageToken_ = other.pageToken_; onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
@Test @SuppressWarnings("all") public void listTopicsTest() { String nextPageToken = ""; Topic topicsElement = Topic.newBuilder().build(); List<Topic> topics = Arrays.asList(topicsElement); ListTopicsResponse expectedResponse = ListTopicsResponse.newBuilder() .setNextPageToken(nextPageToken) .addAllTopics(topics) .build(); mockPublisher.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); ListTopicsPagedResponse pagedListResponse = client.listTopics(project); List<Topic> resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); Assert.assertEquals(expectedResponse.getTopicsList().get(0), resources.get(0)); List<GeneratedMessageV3> actualRequests = mockPublisher.getRequests(); Assert.assertEquals(1, actualRequests.size()); ListTopicsRequest actualRequest = (ListTopicsRequest) actualRequests.get(0); Assert.assertEquals(project, ProjectName.parse(actualRequest.getProject())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.pubsub.v1.ListTopicsRequest)) { return super.equals(obj); } com.google.pubsub.v1.ListTopicsRequest other = (com.google.pubsub.v1.ListTopicsRequest) obj; boolean result = true; result = result && getProject().equals(other.getProject()); result = result && (getPageSize() == other.getPageSize()); result = result && getPageToken().equals(other.getPageToken()); result = result && unknownFields.equals(other.unknownFields); return result; }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.pubsub.v1.ListTopicsRequest)) { return super.equals(obj); } com.google.pubsub.v1.ListTopicsRequest other = (com.google.pubsub.v1.ListTopicsRequest) obj; boolean result = true; result = result && getProject() .equals(other.getProject()); result = result && (getPageSize() == other.getPageSize()); result = result && getPageToken() .equals(other.getPageToken()); return result; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptorForType().hashCode(); hash = (37 * hash) + PROJECT_FIELD_NUMBER; hash = (53 * hash) + getProject().hashCode(); 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; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + PROJECT_FIELD_NUMBER; hash = (53 * hash) + getProject().hashCode(); 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 name of the cloud project that topics belong to. * </pre> * * <code>optional string project = 1;</code> */ public Builder clearProject() { project_ = getDefaultInstance().getProject(); onChanged(); return this; } /**
/** * <code>optional string project = 1;</code> * * <pre> * The name of the cloud project that topics belong to. * </pre> */ public Builder clearProject() { project_ = getDefaultInstance().getProject(); onChanged(); return this; } /**
/** * * * <pre> * The name of the project in which to list topics. * Format is `projects/{project-id}`. * </pre> * * <code>string project = 1;</code> */ public Builder clearProject() { project_ = getDefaultInstance().getProject(); onChanged(); return this; } /**
public Builder mergeFrom(com.google.pubsub.v1.ListTopicsRequest other) { if (other == com.google.pubsub.v1.ListTopicsRequest.getDefaultInstance()) return this; if (!other.getProject().isEmpty()) { project_ = other.project_; onChanged(); } if (other.getPageSize() != 0) { setPageSize(other.getPageSize()); } if (!other.getPageToken().isEmpty()) { pageToken_ = other.pageToken_; onChanged(); } onChanged(); return this; }
public Builder mergeFrom(com.google.pubsub.v1.ListTopicsRequest other) { if (other == com.google.pubsub.v1.ListTopicsRequest.getDefaultInstance()) return this; if (!other.getProject().isEmpty()) { project_ = other.project_; onChanged(); } if (other.getPageSize() != 0) { setPageSize(other.getPageSize()); } if (!other.getPageToken().isEmpty()) { pageToken_ = other.pageToken_; onChanged(); } onChanged(); return this; }
public Builder mergeFrom(com.google.pubsub.v1.ListTopicsRequest other) { if (other == com.google.pubsub.v1.ListTopicsRequest.getDefaultInstance()) return this; if (!other.getProject().isEmpty()) { project_ = other.project_; onChanged(); } if (other.getPageSize() != 0) { setPageSize(other.getPageSize()); } if (!other.getPageToken().isEmpty()) { pageToken_ = other.pageToken_; onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }