Class DefaultValidatableService
- java.lang.Object
-
- de.hybris.platform.cmsfacades.common.validator.impl.DefaultValidatableService
-
- All Implemented Interfaces:
ValidatableService
public class DefaultValidatableService extends java.lang.Object implements ValidatableService
Default Implementation of theValidatableService. This implementation executes the validatable supplier and then checks if there are errors registered. If there are errors present in currentValidationErrors, then it throws a validation exception with the list of Errors.
-
-
Constructor Summary
Constructors Constructor Description DefaultValidatableService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> Texecute(java.util.function.Supplier<T> validatable)Executes the validatable supplier to collect any validation error after executionprotected ValidationErrorsProvidergetValidationErrorsProvider()protected booleanisEmptyCollection(java.util.Collection<?> c)Verifies whether the collection is empty or not.voidsetValidationErrorsProvider(ValidationErrorsProvider validationErrorsProvider)
-
-
-
Method Detail
-
execute
public <T> T execute(java.util.function.Supplier<T> validatable)
Description copied from interface:ValidatableServiceExecutes the validatable supplier to collect any validation error after execution- Specified by:
executein interfaceValidatableService- Parameters:
validatable- the validatable supplier.- Returns:
- the expected result after successful validation
-
isEmptyCollection
protected boolean isEmptyCollection(java.util.Collection<?> c)
Verifies whether the collection is empty or not.
-
getValidationErrorsProvider
protected ValidationErrorsProvider getValidationErrorsProvider()
-
setValidationErrorsProvider
public void setValidationErrorsProvider(ValidationErrorsProvider validationErrorsProvider)
-
-