public Timer serialize(JobContext jobCtx, MarshallerWriteContext outputCtx) { // BehaviorJob, no state BehaviorJobContext bjobCtx = ( BehaviorJobContext ) jobCtx; // write out SlidingTimeWindowContext SlidingTimeWindowContext slCtx = ( SlidingTimeWindowContext ) bjobCtx.behaviorContext; EventFactHandle handle = slCtx.getQueue().peek(); return ProtobufMessages.Timers.Timer.newBuilder() .setType( ProtobufMessages.Timers.TimerType.BEHAVIOR ) .setBehavior( ProtobufMessages.Timers.BehaviorTimer.newBuilder() .setHandleId( handle.getId() ) .build() ) .build(); } }
subBuilder.mergeFrom(behavior_); behavior_ = subBuilder.buildPartial();
/** * <code>optional .org.drools.marshalling.Timers.BehaviorTimer behavior = 4;</code> */ public Builder mergeBehavior(org.drools.marshalling.impl.ProtobufMessages.Timers.BehaviorTimer value) { if (behaviorBuilder_ == null) { if (((bitField0_ & 0x00000008) == 0x00000008) && behavior_ != org.drools.marshalling.impl.ProtobufMessages.Timers.BehaviorTimer.getDefaultInstance()) { behavior_ = org.drools.marshalling.impl.ProtobufMessages.Timers.BehaviorTimer.newBuilder(behavior_).mergeFrom(value).buildPartial(); } else { behavior_ = value; } onChanged(); } else { behaviorBuilder_.mergeFrom(value); } bitField0_ |= 0x00000008; return this; } /**
public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { org.drools.marshalling.impl.ProtobufMessages.Timers.BehaviorTimer parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (org.drools.marshalling.impl.ProtobufMessages.Timers.BehaviorTimer) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int bitField0_;
/** * <code>optional .org.drools.marshalling.Timers.BehaviorTimer behavior = 4;</code> */ public Builder setBehavior( org.drools.marshalling.impl.ProtobufMessages.Timers.BehaviorTimer.Builder builderForValue) { if (behaviorBuilder_ == null) { behavior_ = builderForValue.build(); onChanged(); } else { behaviorBuilder_.setMessage(builderForValue.build()); } bitField0_ |= 0x00000008; return this; } /**
public org.drools.marshalling.impl.ProtobufMessages.Timers.BehaviorTimer buildPartial() { org.drools.marshalling.impl.ProtobufMessages.Timers.BehaviorTimer result = new org.drools.marshalling.impl.ProtobufMessages.Timers.BehaviorTimer(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } result.dEPRECATEDNodeId_ = dEPRECATEDNodeId_; if (((from_bitField0_ & 0x00000002) == 0x00000002)) { to_bitField0_ |= 0x00000002; } result.dEPRECATEDBehaviorIndex_ = dEPRECATEDBehaviorIndex_; if (((from_bitField0_ & 0x00000004) == 0x00000004)) { to_bitField0_ |= 0x00000004; } result.handleId_ = handleId_; result.bitField0_ = to_bitField0_; onBuilt(); return result; }
private static Builder create() { return new Builder(); }
public Builder clone() { return create().mergeFrom(buildPartial()); }
public Builder mergeFrom(org.drools.marshalling.impl.ProtobufMessages.Timers.BehaviorTimer other) { if (other == org.drools.marshalling.impl.ProtobufMessages.Timers.BehaviorTimer.getDefaultInstance()) return this; if (other.hasDEPRECATEDNodeId()) { setDEPRECATEDNodeId(other.getDEPRECATEDNodeId()); } if (other.hasDEPRECATEDBehaviorIndex()) { setDEPRECATEDBehaviorIndex(other.getDEPRECATEDBehaviorIndex()); } if (other.hasHandleId()) { setHandleId(other.getHandleId()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
private Builder() { maybeForceBuilderInitialization(); }
/** * <code>optional int32 DEPRECATED_behavior_index = 2;</code> */ public Builder clearDEPRECATEDBehaviorIndex() { bitField0_ = (bitField0_ & ~0x00000002); dEPRECATEDBehaviorIndex_ = 0; onChanged(); return this; }
/** * <code>optional int32 DEPRECATED_node_id = 1;</code> */ public Builder clearDEPRECATEDNodeId() { bitField0_ = (bitField0_ & ~0x00000001); dEPRECATEDNodeId_ = 0; onChanged(); return this; }
private Builder( com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() {
/** * <code>optional int32 handle_id = 3;</code> */ public Builder clearHandleId() { bitField0_ = (bitField0_ & ~0x00000004); handleId_ = 0; onChanged(); return this; }
/** * <code>optional int32 handle_id = 3;</code> */ public Builder setHandleId(int value) { bitField0_ |= 0x00000004; handleId_ = value; onChanged(); return this; } /**
@java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /**
public static Builder newBuilder(org.drools.marshalling.impl.ProtobufMessages.Timers.BehaviorTimer prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); }
/** * <code>optional int32 DEPRECATED_behavior_index = 2;</code> */ public Builder setDEPRECATEDBehaviorIndex(int value) { bitField0_ |= 0x00000002; dEPRECATEDBehaviorIndex_ = value; onChanged(); return this; } /**
/** * <code>optional int32 DEPRECATED_node_id = 1;</code> */ public Builder setDEPRECATEDNodeId(int value) { bitField0_ |= 0x00000001; dEPRECATEDNodeId_ = value; onChanged(); return this; } /**
public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof org.drools.marshalling.impl.ProtobufMessages.Timers.BehaviorTimer) { return mergeFrom((org.drools.marshalling.impl.ProtobufMessages.Timers.BehaviorTimer)other); } else { super.mergeFrom(other); return this; } }