public com.example.grpc.GoodbyeRequest buildPartial() { com.example.grpc.GoodbyeRequest result = new com.example.grpc.GoodbyeRequest(this); result.name_ = name_; result.reason_ = reason_; onBuilt(); return result; }
/** * <code>string reason = 2;</code> */ public Builder clearReason() { reason_ = getDefaultInstance().getReason(); 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) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); hash = (37 * hash) + REASON_FIELD_NUMBER; hash = (53 * hash) + getReason().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
/** * <code>string name = 1;</code> */ public Builder clearName() { name_ = getDefaultInstance().getName(); onChanged(); return this; } /**
public Builder mergeFrom(com.example.grpc.GoodbyeRequest other) { if (other == com.example.grpc.GoodbyeRequest.getDefaultInstance()) return this; if (!other.getName().isEmpty()) { name_ = other.name_; onChanged(); } if (!other.getReason().isEmpty()) { reason_ = other.reason_; onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!getNameBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); } if (!getReasonBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, reason_); } unknownFields.writeTo(output); }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.example.grpc.GoodbyeRequest)) { return super.equals(obj); } com.example.grpc.GoodbyeRequest other = (com.example.grpc.GoodbyeRequest) obj; boolean result = true; result = result && getName() .equals(other.getName()); result = result && getReason() .equals(other.getReason()); result = result && unknownFields.equals(other.unknownFields); return result; }
break; default: { if (!parseUnknownFieldProto3( input, unknownFields, extensionRegistry, tag)) { done = true; } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable();
public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() {
public com.example.grpc.GoodbyeRequest getDefaultInstanceForType() { return com.example.grpc.GoodbyeRequest.getDefaultInstance(); }
public com.example.grpc.GoodbyeRequest build() { com.example.grpc.GoodbyeRequest result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }
@Override public void goodbye(GoodbyeRequest request, StreamObserver<GoodbyeResponse> responseObserver) { String userId = Constant.USER_ID_CTX_KEY.get(); System.out.println("Goodbye Service Trace ID: " + Constant.TRACE_ID_CTX_KEY.get()); System.out.println("Goodbye Service User ID: " + userId); HelloResponse helloResponse = this.greetingStub.greeting(HelloRequest.newBuilder().setName(request.getName()).build()); System.out.println(helloResponse); String farewell = "Goodye, " + request.getName() + ", your userId is " + userId; responseObserver.onNext(GoodbyeResponse.newBuilder().setFarewell(farewell).build()); responseObserver.onCompleted(); } }
public Builder mergeFrom(com.example.grpc.GoodbyeRequest other) { if (other == com.example.grpc.GoodbyeRequest.getDefaultInstance()) return this; if (!other.getName().isEmpty()) { name_ = other.name_; onChanged(); } if (!other.getReason().isEmpty()) { reason_ = other.reason_; onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!getNameBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); } if (!getReasonBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, reason_); } unknownFields.writeTo(output); }
/** * <code>string name = 1;</code> */ public Builder clearName() { name_ = getDefaultInstance().getName(); onChanged(); return this; } /**
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.example.grpc.GoodbyeRequest)) { return super.equals(obj); } com.example.grpc.GoodbyeRequest other = (com.example.grpc.GoodbyeRequest) obj; boolean result = true; result = result && getName() .equals(other.getName()); result = result && getReason() .equals(other.getReason()); result = result && unknownFields.equals(other.unknownFields); return result; }
break; default: { if (!parseUnknownFieldProto3( input, unknownFields, extensionRegistry, tag)) { done = true; } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable();
public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() {
public com.example.grpc.GoodbyeRequest getDefaultInstanceForType() { return com.example.grpc.GoodbyeRequest.getDefaultInstance(); }
public com.example.grpc.GoodbyeRequest build() { com.example.grpc.GoodbyeRequest result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }