/** * * * <pre> * The name of the topic to get. * Format is `projects/{project}/topics/{topic}`. * </pre> * * <code>string topic = 1;</code> */ public Builder clearTopic() { topic_ = getDefaultInstance().getTopic(); onChanged(); return this; } /**
@java.lang.Override public Builder newBuilderForType() { return newBuilder(); }
@java.lang.Override public com.google.pubsub.v1.GetTopicRequest buildPartial() { com.google.pubsub.v1.GetTopicRequest result = new com.google.pubsub.v1.GetTopicRequest(this); result.topic_ = topic_; onBuilt(); return result; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + TOPIC_FIELD_NUMBER; hash = (53 * hash) + getTopic().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { done = true; } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable();
@java.lang.Override public com.google.pubsub.v1.GetTopicRequest getDefaultInstanceForType() { return com.google.pubsub.v1.GetTopicRequest.getDefaultInstance(); }
@java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (!getTopicBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, topic_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; }
public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.pubsub.v1.GetTopicRequest)) { return super.equals(obj); } com.google.pubsub.v1.GetTopicRequest other = (com.google.pubsub.v1.GetTopicRequest) obj; boolean result = true; result = result && getTopic().equals(other.getTopic()); 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) + getDescriptorForType().hashCode(); hash = (37 * hash) + TOPIC_FIELD_NUMBER; hash = (53 * hash) + getTopic().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@java.lang.Override public com.google.pubsub.v1.GetTopicRequest build() { com.google.pubsub.v1.GetTopicRequest result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }
e).setUnfinishedMessage(this); } finally { makeExtensionsImmutable();
private static io.grpc.MethodDescriptor< com.google.pubsub.v1.GetTopicRequest, com.google.pubsub.v1.Topic> getGetTopicMethodHelper() { io.grpc.MethodDescriptor<com.google.pubsub.v1.GetTopicRequest, com.google.pubsub.v1.Topic> getGetTopicMethod; if ((getGetTopicMethod = PublisherGrpc.getGetTopicMethod) == null) { synchronized (PublisherGrpc.class) { if ((getGetTopicMethod = PublisherGrpc.getGetTopicMethod) == null) { PublisherGrpc.getGetTopicMethod = getGetTopicMethod = io.grpc.MethodDescriptor .<com.google.pubsub.v1.GetTopicRequest, com.google.pubsub.v1.Topic> newBuilder() .setType(io.grpc.MethodDescriptor.MethodType.UNARY) .setFullMethodName( generateFullMethodName("google.pubsub.v1.Publisher", "GetTopic")) .setSampledToLocalTracing(true) .setRequestMarshaller( io.grpc.protobuf.ProtoUtils.marshaller( com.google.pubsub.v1.GetTopicRequest.getDefaultInstance())) .setResponseMarshaller( io.grpc.protobuf.ProtoUtils.marshaller( com.google.pubsub.v1.Topic.getDefaultInstance())) .setSchemaDescriptor(new PublisherMethodDescriptorSupplier("GetTopic")) .build(); } } } return getGetTopicMethod; }
@java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!getTopicBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, topic_); } unknownFields.writeTo(output); }
public static Builder newBuilder(com.google.pubsub.v1.GetTopicRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); }
@Test @SuppressWarnings("all") public void getTopicTest() { ProjectTopicName name = ProjectTopicName.of("[PROJECT]", "[TOPIC]"); Topic expectedResponse = Topic.newBuilder().setName(name.toString()).build(); mockPublisher.addResponse(expectedResponse); ProjectTopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]"); Topic actualResponse = client.getTopic(topic); Assert.assertEquals(expectedResponse, actualResponse); List<GeneratedMessageV3> actualRequests = mockPublisher.getRequests(); Assert.assertEquals(1, actualRequests.size()); GetTopicRequest actualRequest = (GetTopicRequest) actualRequests.get(0); Assert.assertEquals(topic, ProjectTopicName.parse(actualRequest.getTopic())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + TOPIC_FIELD_NUMBER; hash = (53 * hash) + getTopic().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@java.lang.Override public com.google.pubsub.v1.GetTopicRequest build() { com.google.pubsub.v1.GetTopicRequest result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }
if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { done = true; } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable();
e.getMessage()).setUnfinishedMessage(this)); } finally { makeExtensionsImmutable();