@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (getExclusionsCount() > 0) { hash = (37 * hash) + EXCLUSIONS_FIELD_NUMBER; hash = (53 * hash) + getExclusionsList().hashCode(); } hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; hash = (53 * hash) + getNextPageToken().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
/** * * * <pre> * If there might be more results than appear in this response, then * `nextPageToken` is included. To get the next set of results, call the same * method again using the value of `nextPageToken` as `pageToken`. * </pre> * * <code>string next_page_token = 2;</code> */ public Builder clearNextPageToken() { nextPageToken_ = getDefaultInstance().getNextPageToken(); onChanged(); return this; } /**
@java.lang.Override public Builder newBuilderForType() { return newBuilder(); }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.logging.v2.ListExclusionsResponse)) { return super.equals(obj); } com.google.logging.v2.ListExclusionsResponse other = (com.google.logging.v2.ListExclusionsResponse) obj; boolean result = true; result = result && getExclusionsList().equals(other.getExclusionsList()); result = result && getNextPageToken().equals(other.getNextPageToken()); result = result && unknownFields.equals(other.unknownFields); return result; }
@Test @SuppressWarnings("all") public void listExclusionsTest() { String nextPageToken = ""; LogExclusion exclusionsElement = LogExclusion.newBuilder().build(); List<LogExclusion> exclusions = Arrays.asList(exclusionsElement); ListExclusionsResponse expectedResponse = ListExclusionsResponse.newBuilder() .setNextPageToken(nextPageToken) .addAllExclusions(exclusions) .build(); mockConfigServiceV2.addResponse(expectedResponse); ParentName parent = ProjectName.of("[PROJECT]"); ListExclusionsPagedResponse pagedListResponse = client.listExclusions(parent); List<LogExclusion> resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); Assert.assertEquals(expectedResponse.getExclusionsList().get(0), resources.get(0)); List<GeneratedMessageV3> actualRequests = mockConfigServiceV2.getRequests(); Assert.assertEquals(1, actualRequests.size()); ListExclusionsRequest actualRequest = (ListExclusionsRequest) actualRequests.get(0); Assert.assertEquals(parent, ParentNames.parse(actualRequest.getParent())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
@Override public Iterable<LogExclusion> extractResources(ListExclusionsResponse payload) { return payload.getExclusionsList() != null ? payload.getExclusionsList() : ImmutableList.<LogExclusion>of(); } };
@java.lang.Override public com.google.logging.v2.ListExclusionsResponse getDefaultInstanceForType() { return com.google.logging.v2.ListExclusionsResponse.getDefaultInstance(); }
@Override public String extractNextToken(ListExclusionsResponse payload) { return payload.getNextPageToken(); }
@java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { for (int i = 0; i < exclusions_.size(); i++) { output.writeMessage(1, exclusions_.get(i)); } if (!getNextPageTokenBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); } unknownFields.writeTo(output); }
@java.lang.Override public com.google.logging.v2.ListExclusionsResponse buildPartial() { com.google.logging.v2.ListExclusionsResponse result = new com.google.logging.v2.ListExclusionsResponse(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (exclusionsBuilder_ == null) { if (((bitField0_ & 0x00000001) == 0x00000001)) { exclusions_ = java.util.Collections.unmodifiableList(exclusions_); bitField0_ = (bitField0_ & ~0x00000001); } result.exclusions_ = exclusions_; } else { result.exclusions_ = exclusionsBuilder_.build(); } result.nextPageToken_ = nextPageToken_; result.bitField0_ = to_bitField0_; onBuilt(); return result; }
@java.lang.Override public com.google.logging.v2.ListExclusionsResponse build() { com.google.logging.v2.ListExclusionsResponse result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }
@Override public Iterable<LogExclusion> extractResources(ListExclusionsResponse payload) { return payload.getExclusionsList() != null ? payload.getExclusionsList() : ImmutableList.<LogExclusion>of(); } };
.setResponseMarshaller( io.grpc.protobuf.ProtoUtils.marshaller( com.google.logging.v2.ListExclusionsResponse.getDefaultInstance())) .setSchemaDescriptor( new ConfigServiceV2MethodDescriptorSupplier("ListExclusions"))
@Override public String extractNextToken(ListExclusionsResponse payload) { return payload.getNextPageToken(); }
@java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; for (int i = 0; i < exclusions_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, exclusions_.get(i)); } if (!getNextPageTokenBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; }
public Builder mergeFrom(com.google.logging.v2.ListExclusionsResponse other) { if (other == com.google.logging.v2.ListExclusionsResponse.getDefaultInstance()) return this; if (exclusionsBuilder_ == null) { if (!other.exclusions_.isEmpty()) { if (!other.getNextPageToken().isEmpty()) { nextPageToken_ = other.nextPageToken_; onChanged();
.setResponseMarshaller( io.grpc.protobuf.ProtoUtils.marshaller( com.google.logging.v2.ListExclusionsResponse.getDefaultInstance())) .setSchemaDescriptor( new ConfigServiceV2MethodDescriptorSupplier("ListExclusions"))