use of org.talend.dataprep.parameters.Parameter in project data-prep by Talend.
the class LookupTest method shouldAdapt.
@Test
public void shouldAdapt() {
// given
final DataSetMetadata ds = new DataSetMetadata("ds#123", "great dataset", "", 0, 0, new RowMetadata(), "1.0.0");
// when
final Lookup actual = action.adapt(ds);
// when
final List<Parameter> parameters = actual.getParameters(Locale.US);
assertEquals("great dataset", getParamValue(parameters, "lookup_ds_name"));
assertEquals("ds#123", getParamValue(parameters, "lookup_ds_id"));
}
use of org.talend.dataprep.parameters.Parameter in project data-prep by Talend.
the class RemoveRepeatedCharsTest method testGetParameters.
@Test
public void testGetParameters() throws Exception {
final List<Parameter> parameters = action.getParameters(Locale.US);
assertEquals(6, parameters.size());
final SelectParameter parameter4 = (SelectParameter) parameters.get(5);
assertEquals(2, parameter4.getItems().size());
assertEquals("Whitespace", parameter4.getItems().get(0).getLabel());
assertEquals("Other", parameter4.getItems().get(1).getLabel());
}
use of org.talend.dataprep.parameters.Parameter 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;
}
use of org.talend.dataprep.parameters.Parameter in project data-prep by Talend.
the class StandardizeInvalid method getParameters.
@Override
public List<Parameter> getParameters(Locale locale) {
final List<Parameter> parameters = super.getParameters(locale);
Parameter startParameter = selectParameter(locale).name(MATCH_THRESHOLD_PARAMETER).item(MatchThresholdEnum.HIGH.name(), MatchThresholdEnum.HIGH.getLabel()).item(MatchThresholdEnum.DEFAULT.name(), MatchThresholdEnum.DEFAULT.getLabel()).item(MatchThresholdEnum.NONE.name(), MatchThresholdEnum.NONE.getLabel()).defaultValue(MatchThresholdEnum.DEFAULT.name()).build(this);
parameters.add(startParameter);
return parameters;
}
use of org.talend.dataprep.parameters.Parameter in project data-prep by Talend.
the class DateCalendarConverter 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));
final Parameter toJulianDayOrISOParameters = selectParameter(locale).name(TO_CALENDAR_TYPE_PARAMETER).item(ISO.name(), ISO.toString()).item(JULIAN_DAY.name(), JULIAN_DAY.toString()).item(MODIFIED_JULIAN_DAY.name(), MODIFIED_JULIAN_DAY.toString()).item(RATA_DIE.name(), RATA_DIE.toString()).item(EPOCH_DAY.name(), EPOCH_DAY.toString()).defaultValue(ISO.name()).build(this);
final Parameter toCompleteParameters = selectParameter(locale).name(TO_CALENDAR_TYPE_PARAMETER).item(ISO.name(), ISO.toString()).item(HIJRI.name(), HIJRI.toString()).item(JAPANESE.name(), JAPANESE.toString()).item(MINGUO.name(), MINGUO.toString()).item(THAI_BUDDHIST.name(), THAI_BUDDHIST.toString()).item(JULIAN_DAY.name(), JULIAN_DAY.toString()).item(MODIFIED_JULIAN_DAY.name(), MODIFIED_JULIAN_DAY.toString()).item(RATA_DIE.name(), RATA_DIE.toString()).item(EPOCH_DAY.name(), EPOCH_DAY.toString()).defaultValue(MINGUO.name()).build(this);
// @formatter:off
parameters.add(selectParameter(locale).name(FROM_CALENDAR_TYPE_PARAMETER).item(ISO.name(), ISO.toString(), toCompleteParameters).item(HIJRI.name(), HIJRI.toString(), toCompleteParameters).item(JAPANESE.name(), JAPANESE.toString(), toCompleteParameters).item(MINGUO.name(), MINGUO.toString(), toCompleteParameters).item(THAI_BUDDHIST.name(), THAI_BUDDHIST.toString(), toCompleteParameters).item(JULIAN_DAY.name(), JULIAN_DAY.toString(), toJulianDayOrISOParameters).item(MODIFIED_JULIAN_DAY.name(), MODIFIED_JULIAN_DAY.toString(), toJulianDayOrISOParameters).item(RATA_DIE.name(), RATA_DIE.toString(), toJulianDayOrISOParameters).item(EPOCH_DAY.name(), EPOCH_DAY.toString(), toJulianDayOrISOParameters).defaultValue(ISO.name()).build(this));
return parameters;
}
Aggregations