return ProtobufMessages.Trigger.newBuilder()
.setType( ProtobufMessages.Trigger.TriggerType.INTERVAL )
.setInterval( _interval.build() )
.build();
} else if ( trigger instanceof PointInTimeTrigger ) {
PointInTimeTrigger pinTrigger = (PointInTimeTrigger) trigger;
return ProtobufMessages.Trigger.newBuilder()
.setType( ProtobufMessages.Trigger.TriggerType.POINT_IN_TIME )
.setPit( ProtobufMessages.Trigger.PointInTimeTrigger.newBuilder()
.setNextFireTime( pinTrigger.hasNextFireTime().getTime() )
.build() )
.build();
}
throw new RuntimeException( "Unable to serialize Trigger for type: " + trigger.getClass() );
}