private boolean isDuplicate() { final String name = nameTextField.getValue(); final String version = versionTextField.getValue(); final String type = typeComboBox.getValue() != null ? typeComboBox.getValue().toString() : null; final Optional<Long> moduleType = softwareModuleTypeManagement.getByName(type) .map(SoftwareModuleType::getId); if (moduleType.isPresent() && softwareModuleManagement .getByNameAndVersionAndType(name, version, moduleType.get()).isPresent()) { uiNotifcation.displayValidationError( i18n.getMessage("message.duplicate.softwaremodule", new Object[] { name, version })); return true; } return false; }
private boolean isDuplicate() { final String name = nameTextField.getValue(); final String version = versionTextField.getValue(); final String type = typeComboBox.getValue() != null ? typeComboBox.getValue().toString() : null; final Optional<Long> moduleType = softwareModuleTypeManagement.getByName(type) .map(SoftwareModuleType::getId); if (moduleType.isPresent() && softwareModuleManagement .getByNameAndVersionAndType(name, version, moduleType.get()).isPresent()) { uiNotifcation .displayValidationError(i18n.getMessage("message.duplicate.softwaremodule", name, version)); return true; } return false; }