use of org.eclipse.smarthome.automation.type.ModuleType in project smarthome by eclipse.
the class ModuleTypeRegistryImpl method getActions.
@Override
public Collection<ActionType> getActions(Locale locale, String... tags) {
Collection<ModuleType> moduleTypes = getByTags(locale, tags);
Collection<ActionType> actionTypes = new ArrayList<ActionType>();
for (ModuleType mt : moduleTypes) {
if (mt instanceof ActionType) {
actionTypes.add((ActionType) mt);
}
}
return actionTypes;
}
use of org.eclipse.smarthome.automation.type.ModuleType in project smarthome by eclipse.
the class ModuleTypeRegistryImpl method getTriggers.
@Override
public Collection<TriggerType> getTriggers(String... tags) {
Collection<ModuleType> moduleTypes = getByTags(tags);
Collection<TriggerType> triggerTypes = new ArrayList<TriggerType>();
for (ModuleType mt : moduleTypes) {
if (mt instanceof TriggerType) {
triggerTypes.add((TriggerType) mt);
}
}
return triggerTypes;
}
use of org.eclipse.smarthome.automation.type.ModuleType in project smarthome by eclipse.
the class ModuleTypeRegistryImpl method getTriggers.
@Override
public Collection<TriggerType> getTriggers(Locale locale, String... tags) {
Collection<ModuleType> moduleTypes = getByTags(locale, tags);
Collection<TriggerType> triggerTypes = new ArrayList<TriggerType>();
for (ModuleType mt : moduleTypes) {
if (mt instanceof TriggerType) {
triggerTypes.add((TriggerType) mt);
}
}
return triggerTypes;
}
use of org.eclipse.smarthome.automation.type.ModuleType in project smarthome by eclipse.
the class ModuleTypeRegistryImpl method createCopy.
private ModuleType createCopy(ModuleType mType) {
if (mType == null) {
return null;
}
ModuleType result;
if (mType instanceof CompositeTriggerType) {
CompositeTriggerType m = (CompositeTriggerType) mType;
result = new CompositeTriggerType(mType.getUID(), mType.getConfigurationDescriptions(), mType.getLabel(), mType.getDescription(), mType.getTags(), mType.getVisibility(), m.getOutputs(), copyTriggers(m.getChildren()));
} else if (mType instanceof TriggerType) {
TriggerType m = (TriggerType) mType;
result = new TriggerType(mType.getUID(), mType.getConfigurationDescriptions(), mType.getLabel(), mType.getDescription(), mType.getTags(), mType.getVisibility(), m.getOutputs());
} else if (mType instanceof CompositeConditionType) {
CompositeConditionType m = (CompositeConditionType) mType;
result = new CompositeConditionType(mType.getUID(), mType.getConfigurationDescriptions(), mType.getLabel(), mType.getDescription(), mType.getTags(), mType.getVisibility(), m.getInputs(), copyConditions(m.getChildren()));
} else if (mType instanceof ConditionType) {
ConditionType m = (ConditionType) mType;
result = new ConditionType(mType.getUID(), mType.getConfigurationDescriptions(), mType.getLabel(), mType.getDescription(), mType.getTags(), mType.getVisibility(), m.getInputs());
} else if (mType instanceof CompositeActionType) {
CompositeActionType m = (CompositeActionType) mType;
result = new CompositeActionType(mType.getUID(), mType.getConfigurationDescriptions(), mType.getLabel(), mType.getDescription(), mType.getTags(), mType.getVisibility(), m.getInputs(), m.getOutputs(), copyActions(m.getChildren()));
} else if (mType instanceof ActionType) {
ActionType m = (ActionType) mType;
result = new ActionType(mType.getUID(), mType.getConfigurationDescriptions(), mType.getLabel(), mType.getDescription(), mType.getTags(), mType.getVisibility(), m.getInputs(), m.getOutputs());
} else {
throw new IllegalArgumentException("Invalid template type:" + mType);
}
return result;
}
use of org.eclipse.smarthome.automation.type.ModuleType in project smarthome by eclipse.
the class ModuleTypeRegistryImpl method getConditions.
@Override
public Collection<ConditionType> getConditions(Locale locale, String... tags) {
Collection<ModuleType> moduleTypes = getByTags(locale, tags);
Collection<ConditionType> conditionTypes = new ArrayList<ConditionType>();
for (ModuleType mt : moduleTypes) {
if (mt instanceof ConditionType) {
conditionTypes.add((ConditionType) mt);
}
}
return conditionTypes;
}
Aggregations