@Test public void testInferComponentTypeWhenItReturnsExpression() { final ConstraintType expectedType = EXPRESSION; final ConstraintType actualType = modal.inferComponentType("expression"); assertEquals(expectedType, actualType); }
ConstraintType inferComponentType(final String constraintValue) { final String value = Optional.ofNullable(constraintValue).orElse(""); if (isRange(value)) { return RANGE; } else if (isEnumeration(value)) { return ENUMERATION; } else { return EXPRESSION; } }
DataTypeConstraintModal extends Elemental2Modal<DataTypeConstraintModal.View> { ConstraintType inferComponentType(final String constraintValue) { final String value = Optional.ofNullable(constraintValue).orElse(""); if (isRange(value)) { return RANGE; } else if (isEnumeration(value)) { return ENUMERATION; } else { return EXPRESSION; } } }
DataTypeConstraintModal extends Elemental2Modal<DataTypeConstraintModal.View> { ConstraintType inferComponentType(final String constraintValue) { final String value = Optional.ofNullable(constraintValue).orElse(""); if (isRange(value)) { return RANGE; } else if (isEnumeration(value)) { return ENUMERATION; } else { return EXPRESSION; } } @Inject  DataTypeConstraintModal(final View view,
                                   final DataTypeShortcuts dataTypeShortcuts,
                                   final DataTypeConstraintEnumeration constraintEnumeration,
                                   final DataTypeConstraintExpression constraintExpression,
                                   final DataTypeConstraintRange constraintRange); }
DataTypeConstraintModal extends Elemental2Modal<DataTypeConstraintModal.View> { ConstraintType inferComponentType(final String constraintValue) { final String value = Optional.ofNullable(constraintValue).orElse(""); if (isRange(value)) { return RANGE; } else if (isEnumeration(value)) { return ENUMERATION; } else { return EXPRESSION; } } @Inject  DataTypeConstraintModal(final View view,
                                   final DataTypeShortcuts dataTypeShortcuts,
                                   final DataTypeConstraintEnumeration constraintEnumeration,
                                   final DataTypeConstraintExpression constraintExpression,
                                   final DataTypeConstraintRange constraintRange); @PostConstruct void setup(); void save(); void show(final BiConsumer<String, ConstraintType> onSaveConsumer); @Override void hide(); void enableOkButton(); void disableOkButton(); }
DataTypeConstraintModal extends Elemental2Modal<DataTypeConstraintModal.View> { ConstraintType inferComponentType(final String constraintValue) { final String value = Optional.ofNullable(constraintValue).orElse(""); if (isRange(value)) { return RANGE; } else if (isEnumeration(value)) { return ENUMERATION; } else { return EXPRESSION; } } @Inject  DataTypeConstraintModal(final View view,
                                   final DataTypeShortcuts dataTypeShortcuts,
                                   final DataTypeConstraintEnumeration constraintEnumeration,
                                   final DataTypeConstraintExpression constraintExpression,
                                   final DataTypeConstraintRange constraintRange); @PostConstruct void setup(); void save(); void show(final BiConsumer<String, ConstraintType> onSaveConsumer); @Override void hide(); void enableOkButton(); void disableOkButton();  }