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

nl.vpro.domain.validation.NoDuplicateOwner Maven / Gradle / Ivy

Go to download

Several domains like 'media', pages' and 'subtitles' in the POMS system share some common properties which are collected here

There is a newer version: 8.3.1
Show newest version
package nl.vpro.domain.validation;

import java.lang.annotation.*;

import javax.validation.Constraint;
import javax.validation.Payload;

import nl.vpro.domain.media.support.Ownable;

import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * Ensures that a collection of {@link Ownable} contains no two entries with the same {@link Ownable#getOwner()}
 *
 * @author Michiel Meeuwissen
 * @since 5.12
 */
@Target({METHOD, FIELD, PARAMETER})
@Retention(RUNTIME)
@Constraint(validatedBy = NoDuplicateOwnerValidator.class)
@Documented
public @interface NoDuplicateOwner {

    String message() default "The collection contains Ownables with the same owner";

    Class[] groups() default {};

    Class[] payload() default {};
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy