Class ErrorDetailDtoMapper
java.lang.Object
es.kukenan.smartfi.common.service.validation.impl.hibernate.ErrorDetailDtoMapper
Javax constraint to
ErrorDetailDto mapping utilities.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> Set<es.kukenan.smartfi.common.api.dtos.error.ErrorDetailDto>Map a set of constraint violations to a list ofErrorDetailDto.private <T extends Annotation>
StringmapErrorCode(javax.validation.metadata.ConstraintDescriptor<T> violation) Retrieve the error code corresponding to the given violated constraint.
-
Constructor Details
-
ErrorDetailDtoMapper
public ErrorDetailDtoMapper()
-
-
Method Details
-
map
public <T> Set<es.kukenan.smartfi.common.api.dtos.error.ErrorDetailDto> map(Set<javax.validation.ConstraintViolation<T>> violations) Map a set of constraint violations to a list ofErrorDetailDto.- Type Parameters:
T- the type of the root bean.- Parameters:
violations- the given constraint violations.- Returns:
- the corresponding
ErrorDetailDtolist to the givenConstraintViolationset.
-
mapErrorCode
private <T extends Annotation> String mapErrorCode(javax.validation.metadata.ConstraintDescriptor<T> violation) Retrieve the error code corresponding to the given violated constraint.- Type Parameters:
T- the constraint class.- Parameters:
violation- the viaolated constraint descriptor.- Returns:
- the error code for the given constraint.
-