Search in sources :

Example 1 with ActionOutput

use of org.eclipse.smarthome.automation.annotation.ActionOutput in project smarthome by eclipse.

the class AnnotationActionModuleTypeHelper method getOutputsFromMethod.

private List<Output> getOutputsFromMethod(Method method) {
    List<Output> outputs = new ArrayList<>();
    if (method.isAnnotationPresent(ActionOutputs.class)) {
        for (ActionOutput ruleActionOutput : method.getAnnotationsByType(ActionOutput.class)) {
            Output output = new Output(ruleActionOutput.name(), ruleActionOutput.type(), ruleActionOutput.label(), ruleActionOutput.description(), Arrays.stream(ruleActionOutput.tags()).collect(Collectors.toSet()), ruleActionOutput.reference(), ruleActionOutput.defaultValue());
            outputs.add(output);
        }
    }
    return outputs;
}
Also used : Output(org.eclipse.smarthome.automation.type.Output) ActionOutput(org.eclipse.smarthome.automation.annotation.ActionOutput) ArrayList(java.util.ArrayList) ActionOutput(org.eclipse.smarthome.automation.annotation.ActionOutput)

Aggregations

ArrayList (java.util.ArrayList)1 ActionOutput (org.eclipse.smarthome.automation.annotation.ActionOutput)1 Output (org.eclipse.smarthome.automation.type.Output)1