com.github.angelowolf.implementaciones.ValidacionMaximo Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of validacion Show documentation
Show all versions of validacion Show documentation
Libreria para validar objetos java
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;
}
}