private void activateSensors(List<Option> config) { // this.selectedSensors = Arrays.asList(SensorNames.ALL_SENSOR_KEYS); this.selectedSensors = new ArrayList<>(); for (Option option : config) { if (option.isSelected()) { this.selectedSensors.add(option.getInternalName()); } } }
private void activateSensors(List<Option> config) { // this.selectedSensors = Arrays.asList(SensorNames.ALL_SENSOR_KEYS); this.selectedSensors = new ArrayList<>(); for (Option option : config) { if (option.isSelected()) { this.selectedSensors.add(option.getInternalName()); } } }
public <V> V selectedSingleValueInternalName(String internalName, Class<V> targetClass) { return typeParser.parse(getStaticPropertyByName(internalName, OneOfStaticProperty.class) .getOptions() .stream() .filter(Option::isSelected) .findFirst() .get() .getInternalName(), targetClass); }
public Option(Option o) { super(o); this.name = o.getName(); this.selected = o.isSelected(); this.internalName = o.getInternalName(); }
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; }