public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() {
@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) + AGE_FIELD_NUMBER; hash = (53 * hash) + getAge(); if (getHobbiesCount() > 0) { hash = (37 * hash) + HOBBIES_FIELD_NUMBER; hash = (53 * hash) + getHobbiesList().hashCode(); } if (!internalGetBagOfTricks().getMap().isEmpty()) { hash = (37 * hash) + BAGOFTRICKS_FIELD_NUMBER; hash = (53 * hash) + internalGetBagOfTricks().hashCode(); } hash = (37 * hash) + SENTIMENT_FIELD_NUMBER; hash = (53 * hash) + sentiment_; hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
/** * Use {@link #getBagOfTricksMap()} instead. */ @java.lang.Deprecated public java.util.Map<java.lang.String, java.lang.String> getBagOfTricks() { return getBagOfTricksMap(); } /**
/** * <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.HelloRequest)) { return super.equals(obj); } com.example.grpc.HelloRequest other = (com.example.grpc.HelloRequest) obj; boolean result = true; result = result && getName() .equals(other.getName()); result = result && (getAge() == other.getAge()); result = result && getHobbiesList() .equals(other.getHobbiesList()); result = result && internalGetBagOfTricks().equals( other.internalGetBagOfTricks()); result = result && sentiment_ == other.sentiment_; result = result && unknownFields.equals(other.unknownFields); return result; }
public Builder mergeFrom(com.example.grpc.HelloRequest other) { if (other == com.example.grpc.HelloRequest.getDefaultInstance()) return this; if (!other.getName().isEmpty()) { name_ = other.name_; onChanged(); } if (other.getAge() != 0L) { setAge(other.getAge()); } if (!other.hobbies_.isEmpty()) { if (hobbies_.isEmpty()) { hobbies_ = other.hobbies_; bitField0_ = (bitField0_ & ~0x00000004); } else { ensureHobbiesIsMutable(); hobbies_.addAll(other.hobbies_); } onChanged(); } internalGetMutableBagOfTricks().mergeFrom( other.internalGetBagOfTricks()); if (other.sentiment_ != 0) { setSentimentValue(other.getSentimentValue()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
if (!getNameBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); dataSize += computeStringSizeNoTag(hobbies_.getRaw(i)); size += 1 * getHobbiesList().size(); : internalGetBagOfTricks().getMap().entrySet()) { com.google.protobuf.MapEntry<java.lang.String, java.lang.String> bagOfTricks__ = BagOfTricksDefaultEntryHolder.defaultEntry.newBuilderForType()
public com.example.grpc.HelloRequest getDefaultInstanceForType() { return com.example.grpc.HelloRequest.getDefaultInstance(); }
@Override public void greeting(HelloRequest request, StreamObserver<HelloResponse> responseObserver) { System.out.println(request); String greeting = "Hello there, " + request.getName(); HelloResponse response = HelloResponse.newBuilder().setGreeting(greeting).build(); responseObserver.onNext(response); responseObserver.onCompleted(); } }
public com.example.grpc.HelloRequest buildPartial() { com.example.grpc.HelloRequest result = new com.example.grpc.HelloRequest(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; result.name_ = name_; result.age_ = age_; if (((bitField0_ & 0x00000004) == 0x00000004)) { hobbies_ = hobbies_.getUnmodifiableView(); bitField0_ = (bitField0_ & ~0x00000004); } result.hobbies_ = hobbies_; result.bagOfTricks_ = internalGetBagOfTricks(); result.bagOfTricks_.makeImmutable(); result.sentiment_ = sentiment_; result.bitField0_ = to_bitField0_; onBuilt(); return result; }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.example.grpc.HelloRequest)) { return super.equals(obj); } com.example.grpc.HelloRequest other = (com.example.grpc.HelloRequest) obj; boolean result = true; result = result && getName() .equals(other.getName()); result = result && (getAge() == other.getAge()); result = result && getHobbiesList() .equals(other.getHobbiesList()); result = result && internalGetBagOfTricks().equals( other.internalGetBagOfTricks()); result = result && sentiment_ == other.sentiment_; result = result && unknownFields.equals(other.unknownFields); return result; }
public Builder mergeFrom(com.example.grpc.HelloRequest other) { if (other == com.example.grpc.HelloRequest.getDefaultInstance()) return this; if (!other.getName().isEmpty()) { name_ = other.name_; onChanged(); } if (other.getAge() != 0) { setAge(other.getAge()); } if (!other.hobbies_.isEmpty()) { if (hobbies_.isEmpty()) { hobbies_ = other.hobbies_; bitField0_ = (bitField0_ & ~0x00000004); } else { ensureHobbiesIsMutable(); hobbies_.addAll(other.hobbies_); } onChanged(); } internalGetMutableBagOfTricks().mergeFrom( other.internalGetBagOfTricks()); if (other.sentiment_ != 0) { setSentimentValue(other.getSentimentValue()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
if (!getNameBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); dataSize += computeStringSizeNoTag(hobbies_.getRaw(i)); size += 1 * getHobbiesList().size(); : internalGetBagOfTricks().getMap().entrySet()) { com.google.protobuf.MapEntry<java.lang.String, java.lang.String> bagOfTricks__ = BagOfTricksDefaultEntryHolder.defaultEntry.newBuilderForType()
/** * <code>string name = 1;</code> */ public Builder clearName() { name_ = getDefaultInstance().getName(); onChanged(); return this; } /**
public com.example.grpc.HelloRequest getDefaultInstanceForType() { return com.example.grpc.HelloRequest.getDefaultInstance(); }
@Override public void greeting(HelloRequest request, StreamObserver<HelloResponse> responseObserver) { System.out.println(request); String greeting = "Hello there, " + request.getName(); HelloResponse response = HelloResponse.newBuilder().setGreeting(greeting).build(); responseObserver.onNext(response); responseObserver.onCompleted(); } }
public com.example.grpc.HelloRequest buildPartial() { com.example.grpc.HelloRequest result = new com.example.grpc.HelloRequest(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; result.name_ = name_; result.age_ = age_; if (((bitField0_ & 0x00000004) == 0x00000004)) { hobbies_ = hobbies_.getUnmodifiableView(); bitField0_ = (bitField0_ & ~0x00000004); } result.hobbies_ = hobbies_; result.bagOfTricks_ = internalGetBagOfTricks(); result.bagOfTricks_.makeImmutable(); result.sentiment_ = sentiment_; result.bitField0_ = to_bitField0_; 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) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); hash = (37 * hash) + AGE_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( getAge()); if (getHobbiesCount() > 0) { hash = (37 * hash) + HOBBIES_FIELD_NUMBER; hash = (53 * hash) + getHobbiesList().hashCode(); } if (!internalGetBagOfTricks().getMap().isEmpty()) { hash = (37 * hash) + BAGOFTRICKS_FIELD_NUMBER; hash = (53 * hash) + internalGetBagOfTricks().hashCode(); } hash = (37 * hash) + SENTIMENT_FIELD_NUMBER; hash = (53 * hash) + sentiment_; hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.example.grpc.HelloRequest)) { return super.equals(obj); } com.example.grpc.HelloRequest other = (com.example.grpc.HelloRequest) obj; boolean result = true; result = result && getName() .equals(other.getName()); result = result && (getAge() == other.getAge()); result = result && getHobbiesList() .equals(other.getHobbiesList()); result = result && internalGetBagOfTricks().equals( other.internalGetBagOfTricks()); result = result && sentiment_ == other.sentiment_; result = result && unknownFields.equals(other.unknownFields); return result; }
public Builder mergeFrom(com.example.grpc.HelloRequest other) { if (other == com.example.grpc.HelloRequest.getDefaultInstance()) return this; if (!other.getName().isEmpty()) { name_ = other.name_; onChanged(); } if (other.getAge() != 0L) { setAge(other.getAge()); } if (!other.hobbies_.isEmpty()) { if (hobbies_.isEmpty()) { hobbies_ = other.hobbies_; bitField0_ = (bitField0_ & ~0x00000004); } else { ensureHobbiesIsMutable(); hobbies_.addAll(other.hobbies_); } onChanged(); } internalGetMutableBagOfTricks().mergeFrom( other.internalGetBagOfTricks()); if (other.sentiment_ != 0) { setSentimentValue(other.getSentimentValue()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }