/** * Creates a {@link RESTActionType} based on the specified {@link ActionType} and localized using the specified language. * * @param actionType the {@link ActionType} to be localized * @param language the language to use to localize {@link ActionType} * @return a {@link RESTActionType} based on the specified {@link ActionType} and localized using the specified language */ public RESTActionType generateAction(ActionType actionType, String language) { RESTActionType result = new RESTActionType(); result.setId(actionType.getItemId()); result.setVersion(actionType.getVersion()); result.setName(actionType.getMetadata().getName()); result.setDescription(actionType.getMetadata().getDescription()); result.setTags(actionType.getMetadata().getTags()); result.setSystemTags(actionType.getMetadata().getSystemTags()); List<RESTParameter> parameters = new ArrayList<RESTParameter>(); for (Parameter parameter : actionType.getParameters()) { parameters.add(generateParameter(parameter, language)); } result.setParameters(parameters); return result; }
/** * Creates a {@link RESTConditionType} based on the specified {@link ConditionType} and localized using the specified language. * * @param conditionType the {@link ConditionType} to be localized * @param language the language to use to localize {@link ConditionType} * @return a {@link RESTConditionType} based on the specified {@link ConditionType} and localized using the specified language */ public RESTConditionType generateCondition(ConditionType conditionType, String language) { RESTConditionType result = new RESTConditionType(); result.setId(conditionType.getItemId()); result.setVersion(conditionType.getVersion()); result.setName(conditionType.getMetadata().getName()); result.setDescription(conditionType.getMetadata().getDescription()); result.setTags(conditionType.getMetadata().getTags()); result.setSystemTags(conditionType.getMetadata().getSystemTags()); for (Parameter parameter : conditionType.getParameters()) { result.getParameters().add(generateParameter(parameter, language)); } return result; }