public static FixedOutputStrategy fixed(List<EventProperty> appendProperties) { return new FixedOutputStrategy(appendProperties); }
public FixedOutputStrategy(FixedOutputStrategy other) { super(other); this.eventProperties = new Cloner().properties(other.getEventProperties()); }
public OutputSchemaGenerator<?> getOuputSchemaGenerator() { if (firstOutputStrategy instanceof AppendOutputStrategy) return new AppendOutputSchemaGenerator(((AppendOutputStrategy) firstOutputStrategy).getEventProperties()); else if (firstOutputStrategy instanceof KeepOutputStrategy) return new RenameOutputSchemaGenerator((KeepOutputStrategy) firstOutputStrategy); else if (firstOutputStrategy instanceof FixedOutputStrategy) return new FixedOutputSchemaGenerator(((FixedOutputStrategy) firstOutputStrategy).getEventProperties()); else if (firstOutputStrategy instanceof CustomOutputStrategy) return new CustomOutputSchemaGenerator(((CustomOutputStrategy) firstOutputStrategy).getEventProperties()); else if (firstOutputStrategy instanceof ListOutputStrategy) return new ListOutputSchemaGenerator(((ListOutputStrategy) firstOutputStrategy).getPropertyName()); else if (firstOutputStrategy instanceof TransformOutputStrategy) { return new TransformOutputSchemaGenerator(dataProcessorInvocation, (TransformOutputStrategy) firstOutputStrategy); } else if (firstOutputStrategy instanceof CustomTransformOutputStrategy) { return new CustomTransformOutputSchemaGenerator(dataProcessorInvocation, (CustomTransformOutputStrategy) firstOutputStrategy); } else { throw new IllegalArgumentException(); } } }
/** * Creates a {@link org.streampipes.model.output.FixedOutputStrategy}. Fixed output strategies always output the * schema defined by the pipeline element itself. * @param fixedProperties An arbitrary number of event properties that form the output event schema * @return FixedOutputStrategy */ public static FixedOutputStrategy fixed(EventProperty... fixedProperties) { return new FixedOutputStrategy(Arrays.asList(fixedProperties)); }
public OutputSchemaGenerator<?> getOuputSchemaGenerator() { if (firstOutputStrategy instanceof AppendOutputStrategy) return new AppendOutputSchemaGenerator(((AppendOutputStrategy) firstOutputStrategy).getEventProperties()); else if (firstOutputStrategy instanceof KeepOutputStrategy) return new RenameOutputSchemaGenerator((KeepOutputStrategy) firstOutputStrategy); else if (firstOutputStrategy instanceof FixedOutputStrategy) return new FixedOutputSchemaGenerator(((FixedOutputStrategy) firstOutputStrategy).getEventProperties()); else if (firstOutputStrategy instanceof CustomOutputStrategy) return new CustomOutputSchemaGenerator(((CustomOutputStrategy) firstOutputStrategy).getEventProperties()); else if (firstOutputStrategy instanceof ListOutputStrategy) return new ListOutputSchemaGenerator(((ListOutputStrategy) firstOutputStrategy).getPropertyName()); else if (firstOutputStrategy instanceof TransformOutputStrategy) { return new TransformOutputSchemaGenerator(dataProcessorInvocation, (TransformOutputStrategy) firstOutputStrategy); } else if (firstOutputStrategy instanceof CustomTransformOutputStrategy) { return new CustomTransformOutputSchemaGenerator(dataProcessorInvocation, (CustomTransformOutputStrategy) firstOutputStrategy); } else { throw new IllegalArgumentException(); } } }
public OutputStrategy outputStrategy(OutputStrategy other) { if (other instanceof KeepOutputStrategy) { return new KeepOutputStrategy((KeepOutputStrategy) other); } else if (other instanceof FixedOutputStrategy) { return new FixedOutputStrategy((FixedOutputStrategy) other); } else if (other instanceof ListOutputStrategy) { return new ListOutputStrategy((ListOutputStrategy) other); } else if (other instanceof CustomOutputStrategy) { return new CustomOutputStrategy((CustomOutputStrategy) other); } else if (other instanceof TransformOutputStrategy) { return new TransformOutputStrategy((TransformOutputStrategy) other); } else if (other instanceof CustomTransformOutputStrategy) { return new CustomTransformOutputStrategy((CustomTransformOutputStrategy) other); } else { return new AppendOutputStrategy((AppendOutputStrategy) other); } }