All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.sap.cloud.yaas.servicesdk.auditbase.validation.CustomValidated Maven / Gradle / Ivy

The newest version!
/*
 * © 2017 SAP SE or an SAP affiliate company.
 * All rights reserved.
 * Please see http://www.sap.com/corporate-en/legal/copyright/index.epx for additional trademark information and
 * notices.
 */
package com.sap.cloud.yaas.servicesdk.auditbase.validation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.Collection;
import java.util.function.Function;


/**
 * Used to mark a field that should be validated by a custom validator (see {@link Validator}).
 */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface CustomValidated
{
	/**
	 * The validator must extend {@link Function>} interface and
	 * apply the validation to the object, producing a collection of validation violations. It must also have a default
	 * public constructor.
	 *
	 * If the object is valid it should return an empty collection.
	 *
	 * @return the validator
	 */
	Class>> validator();

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy