public List<String> selectedMultiValues(String internalName) { return ((SelectionStaticProperty) getStaticPropertyByName(internalName)) .getOptions() .stream() .filter(Option::isSelected) .map(Option::getName) .collect(Collectors.toList()); }
public List<String> selectedMultiValues(String internalName) { return ((SelectionStaticProperty) getStaticPropertyByName(internalName)) .getOptions() .stream() .filter(Option::isSelected) .map(Option::getName) .collect(Collectors.toList()); }
private <V, T extends SelectionStaticProperty> V selectedSingleValue(String internalName, Class<V> targetClass, Class<T> oneOfStaticProperty) { return typeParser.parse(getStaticPropertyByName(internalName, oneOfStaticProperty) .getOptions() .stream() .filter(Option::isSelected) .findFirst() .get() .getName(), targetClass); }
public BoundPipelineElementBuilder withPredefinedSelection(String internalStaticPropertyId, List<String> selectedOptions) { this.streamPipesEntity.getStaticProperties().stream().filter(sp -> sp instanceof SelectionStaticProperty).forEach(sp -> { if (sp.getInternalName().equals(internalStaticPropertyId)) { sp.setPredefined(true); ((SelectionStaticProperty) sp).getOptions().forEach(o -> { if (selectedOptions.stream().anyMatch(so -> so.equals(o.getName()))) { o.setSelected(true); } }); } }); return this; }
public SelectionStaticProperty(SelectionStaticProperty other) { super(other); this.options = new Cloner().options(other.getOptions()); }
private EventProperty modifyEventProperty(EventProperty eventProperty, StaticProperty staticProperty, TransformOperationType transformOperationType) { if (staticProperty instanceof SelectionStaticProperty) { return modifyEventProperty(eventProperty, transformOperationType, findSelected(((SelectionStaticProperty) staticProperty).getOptions()).getInternalName()); } else if (staticProperty instanceof FreeTextStaticProperty) { return modifyEventProperty(eventProperty, transformOperationType, ((FreeTextStaticProperty) staticProperty) .getValue ()); } return eventProperty; }
private EventProperty modifyEventProperty(EventProperty eventProperty, StaticProperty staticProperty, TransformOperationType transformOperationType) { if (staticProperty instanceof SelectionStaticProperty) { return modifyEventProperty(eventProperty, transformOperationType, findSelected(((SelectionStaticProperty) staticProperty).getOptions()).getInternalName()); } else if (staticProperty instanceof FreeTextStaticProperty) { return modifyEventProperty(eventProperty, transformOperationType, ((FreeTextStaticProperty) staticProperty) .getValue ()); } return eventProperty; }