public static AppendOutputStrategy append(List<EventProperty> appendProperties) { return new AppendOutputStrategy(appendProperties); }
@Override public AppendOutputStrategy getModifiedOutputStrategy( AppendOutputStrategy strategy) { strategy.setEventProperties(renamedProperties); return strategy; }
public AppendOutputStrategy(AppendOutputStrategy other) { super(other); this.setEventProperties(new Cloner().properties(other.getEventProperties())); }
public Builder getAppendOutputStrategy(Builder b, AppendOutputStrategy aos, int n) { b.addStatement("$T outputStrategy$L = new $T()", JFC.APPEND_OUTPUT_STRATEGY, n, JFC.APPEND_OUTPUT_STRATEGY); b.addStatement("$T<$T> appendProperties = new $T<$T>()", JFC.LIST, JFC.EVENT_PROPERTY, JFC.ARRAY_LIST, JFC.EVENT_PROPERTY); for (EventProperty ep : aos.getEventProperties()) { // TODO b.addStatement("appendProperties.add($T.stringEp($S, $S))", JFC.EP_PROPERTIES, ep.getRuntimeName(), ep.getDomainProperties().get(0).toString()); } b.addStatement("outputStrategy$L.setEventProperties(appendProperties)", n); return b; }
public Builder getAppendOutputStrategy(Builder b, AppendOutputStrategy aos, int n) { b.addStatement("$T outputStrategy$L = new $T()", JFC.APPEND_OUTPUT_STRATEGY, n, JFC.APPEND_OUTPUT_STRATEGY); b.addStatement("$T<$T> appendProperties = new $T<$T>()", JFC.LIST, JFC.EVENT_PROPERTY, JFC.ARRAY_LIST, JFC.EVENT_PROPERTY); for (EventProperty ep : aos.getEventProperties()) { // TODO b.addStatement("appendProperties.add($T.stringEp($S, $S))", JFC.EP_PROPERTIES, ep.getRuntimeName(), ep.getDomainProperties().get(0).toString()); } b.addStatement("outputStrategy$L.setEventProperties(appendProperties)", n); return b; }
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.AppendOutputStrategy}. Append output strategies add additional * properties to an input event stream. * @param appendProperties An arbitrary number of event properties that are appended to any input stream. * @return AppendOutputStrategy */ public static AppendOutputStrategy append(EventProperty... appendProperties) { return new AppendOutputStrategy(Arrays.asList(appendProperties)); }
@Override public AppendOutputStrategy getModifiedOutputStrategy( AppendOutputStrategy strategy) { strategy.setEventProperties(renamedProperties); return strategy; }
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); } }