// Programmatic mapping API
//
// Version ignoring the annotation parameters
// The lambda file type is inferred from addConstraintImplementor class parameter
mapping
.addConstraintImplementor(IsFile.class).validating( (file) -> file.isFile() );
// Version using annotation parameters
// The lambda annotation type is inferred from addConstraintImplementor class parameter
mapping
.addConstraintImplementor(CheckFileType.class)
.validating( (annotation, file) -> annotation.isFile() && file.isFile() );