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

com.github.angelowolf.implementaciones.ValidacionMaximo Maven / Gradle / Ivy

The newest version!
package com.github.angelowolf.implementaciones;

import com.github.angelowolf.validacion.IValidable;

/**
 * Verifica si el objeto es nulo o supera el maximo.
 *
 * @author Angelo Wolf [email protected]
 */
public class ValidacionMaximo implements IValidable {

    private final Comparable maximo;

    public ValidacionMaximo(Comparable maximo) {
        this.maximo = maximo;
    }

    @Override
    public boolean validate(Comparable propiedadAEvaluar) {
        if (propiedadAEvaluar == null) {
            return true;
        }
        return maximo.compareTo(propiedadAEvaluar) > 0;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy