/** * <code>.org.apache.geode.internal.protocol.protobuf.v1.PutIfAbsentResponse putIfAbsentResponse = 35;</code> */ public Builder setPutIfAbsentResponse( org.apache.geode.internal.protocol.protobuf.v1.RegionAPI.PutIfAbsentResponse.Builder builderForValue) { if (putIfAbsentResponseBuilder_ == null) { messageType_ = builderForValue.build(); onChanged(); } else { putIfAbsentResponseBuilder_.setMessage(builderForValue.build()); } messageTypeCase_ = 35; return this; } /**
/** * <code>.org.apache.geode.internal.protocol.protobuf.v1.PutIfAbsentResponse putIfAbsentResponse = 35;</code> */ public Builder mergePutIfAbsentResponse(org.apache.geode.internal.protocol.protobuf.v1.RegionAPI.PutIfAbsentResponse value) { if (putIfAbsentResponseBuilder_ == null) { if (messageTypeCase_ == 35 && messageType_ != org.apache.geode.internal.protocol.protobuf.v1.RegionAPI.PutIfAbsentResponse.getDefaultInstance()) { messageType_ = org.apache.geode.internal.protocol.protobuf.v1.RegionAPI.PutIfAbsentResponse.newBuilder((org.apache.geode.internal.protocol.protobuf.v1.RegionAPI.PutIfAbsentResponse) messageType_) .mergeFrom(value).buildPartial(); } else { messageType_ = value; } onChanged(); } else { if (messageTypeCase_ == 35) { putIfAbsentResponseBuilder_.mergeFrom(value); } putIfAbsentResponseBuilder_.setMessage(value); } messageTypeCase_ = 35; return this; } /**
/** * <code>.org.apache.geode.internal.protocol.protobuf.v1.EncodedValue oldValue = 1;</code> */ private com.google.protobuf.SingleFieldBuilderV3< org.apache.geode.internal.protocol.protobuf.v1.BasicTypes.EncodedValue, org.apache.geode.internal.protocol.protobuf.v1.BasicTypes.EncodedValue.Builder, org.apache.geode.internal.protocol.protobuf.v1.BasicTypes.EncodedValueOrBuilder> getOldValueFieldBuilder() { if (oldValueBuilder_ == null) { oldValueBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< org.apache.geode.internal.protocol.protobuf.v1.BasicTypes.EncodedValue, org.apache.geode.internal.protocol.protobuf.v1.BasicTypes.EncodedValue.Builder, org.apache.geode.internal.protocol.protobuf.v1.BasicTypes.EncodedValueOrBuilder>( getOldValue(), getParentForChildren(), isClean()); oldValue_ = null; } return oldValueBuilder_; } @java.lang.Override
input.readMessage(org.apache.geode.internal.protocol.protobuf.v1.RegionAPI.PutIfAbsentResponse.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom((org.apache.geode.internal.protocol.protobuf.v1.RegionAPI.PutIfAbsentResponse) messageType_); messageType_ = subBuilder.buildPartial();
@java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { org.apache.geode.internal.protocol.protobuf.v1.RegionAPI.PutIfAbsentResponse parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (org.apache.geode.internal.protocol.protobuf.v1.RegionAPI.PutIfAbsentResponse) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; }
@Override public Result<RegionAPI.PutIfAbsentResponse> process( ProtobufSerializationService serializationService, RegionAPI.PutIfAbsentRequest request, MessageExecutionContext messageExecutionContext) throws InvalidExecutionContextException, ConnectionStateException, EncodingException, DecodingException { final String regionName = request.getRegionName(); final BasicTypes.Entry entry = request.getEntry(); Object decodedValue = serializationService.decode(entry.getValue()); Object decodedKey = serializationService.decode(entry.getKey()); final Object oldValue = messageExecutionContext.getSecureCache().putIfAbsent(regionName, decodedKey, decodedValue); return Success.of(RegionAPI.PutIfAbsentResponse.newBuilder() .setOldValue(serializationService.encode(oldValue)).build()); } }
private Builder() { maybeForceBuilderInitialization(); }
public static Builder newBuilder(org.apache.geode.internal.protocol.protobuf.v1.RegionAPI.PutIfAbsentResponse prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override
@java.lang.Override public org.apache.geode.internal.protocol.protobuf.v1.RegionAPI.PutIfAbsentResponse build() { org.apache.geode.internal.protocol.protobuf.v1.RegionAPI.PutIfAbsentResponse result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }
@java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /**
private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() {
@java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof org.apache.geode.internal.protocol.protobuf.v1.RegionAPI.PutIfAbsentResponse) { return mergeFrom((org.apache.geode.internal.protocol.protobuf.v1.RegionAPI.PutIfAbsentResponse)other); } else { super.mergeFrom(other); return this; } }
/** * <code>.org.apache.geode.internal.protocol.protobuf.v1.EncodedValue oldValue = 1;</code> */ public org.apache.geode.internal.protocol.protobuf.v1.BasicTypes.EncodedValue.Builder getOldValueBuilder() { onChanged(); return getOldValueFieldBuilder().getBuilder(); } /**
public Builder mergeFrom(org.apache.geode.internal.protocol.protobuf.v1.RegionAPI.PutIfAbsentResponse other) { if (other == org.apache.geode.internal.protocol.protobuf.v1.RegionAPI.PutIfAbsentResponse.getDefaultInstance()) return this; if (other.hasOldValue()) { mergeOldValue(other.getOldValue()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }