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

nl.vpro.domain.validation.EmbargoValidator 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

The newest version!
package nl.vpro.domain.validation;

import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;

import nl.vpro.domain.Embargo;

/**
 * @author Michiel Meeuwissen
 * @since 5.12
 */
public class EmbargoValidator implements ConstraintValidator {


    @Override
    public boolean isValid(Embargo value, ConstraintValidatorContext constraintValidatorContext) {
        return value.getPublishStartInstant() == null
            || value.getPublishStopInstant() == null
            || (!value.getPublishStartInstant().isAfter(value.getPublishStopInstant()));

    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy