use of org.talend.dataprep.parameters.SelectParameter.SelectParameterBuilder in project data-prep by Talend.
the class DistanceConverter method getParameters.
/**
* @return The list of parameters required for this Action to be executed.
*/
@Override
public List<Parameter> getParameters(Locale locale) {
final List<Parameter> parameters = super.getParameters(locale);
parameters.add(ActionsUtils.getColumnCreationParameter(locale, CREATE_NEW_COLUMN_DEFAULT));
SelectParameterBuilder builder = selectParameter(locale).item(MILLIMETER.name(), MILLIMETER.getShortName()).item(CENTIMETER.name(), CENTIMETER.getShortName()).item(DECIMETER.name(), DECIMETER.getShortName()).item(METER.name(), METER.getShortName()).item(DEKAMETER.name(), DEKAMETER.getShortName()).item(HECTOMETER.name(), HECTOMETER.getShortName()).item(KILOMETER.name(), KILOMETER.getShortName()).item(INCH.name(), INCH.getShortName()).item(FOOT.name(), FOOT.getShortName()).item(YARD.name(), YARD.getShortName()).item(MILE.name(), MILE.getShortName()).item(NAUTICAL_MILE.name(), NAUTICAL_MILE.getShortName()).item(LIGHT_YEAR.name(), LIGHT_YEAR.getShortName()).canBeBlank(false);
parameters.add(builder.name(FROM_UNIT_PARAMETER).defaultValue(MILE.name()).build(this));
builder.setLabel(null).setDescription(null);
parameters.add(builder.name(TO_UNIT_PARAMETER).defaultValue(KILOMETER.name()).build(this));
parameters.add(parameter(locale).setName(TARGET_PRECISION).setType(INTEGER).setDefaultValue("2").setPlaceHolder("precision").build(this));
return parameters;
}
use of org.talend.dataprep.parameters.SelectParameter.SelectParameterBuilder in project data-prep by Talend.
the class DurationConverter method getParameters.
@Override
public List<Parameter> getParameters(Locale locale) {
final List<Parameter> parameters = super.getParameters(locale);
parameters.add(ActionsUtils.getColumnCreationParameter(locale, CREATE_NEW_COLUMN_DEFAULT));
// @formatter:off
SelectParameterBuilder builder = selectParameter(locale).item(YEARS.name(), YEARS.toString()).item(MONTHS.name(), MONTHS.toString()).item(WEEKS.name(), WEEKS.toString()).item(DAYS.name(), DAYS.toString()).item(HOURS.name(), HOURS.toString()).item(MINUTES.name(), MINUTES.toString()).item(SECONDS.name(), SECONDS.toString()).item(MILLIS.name(), MILLIS.toString()).canBeBlank(false);
parameters.add(builder.name(FROM_UNIT_PARAMETER).defaultValue(DAYS.name()).build(this));
builder.setDescription(null).setLabel(null);
parameters.add(builder.name(TO_UNIT_PARAMETER).defaultValue(HOURS.name()).build(this));
parameters.add(parameter(locale).setName(TARGET_PRECISION).setType(INTEGER).setDefaultValue("1").setPlaceHolder("precision").build(this));
// @formatter:on
return parameters;
}
Aggregations