/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package validacion;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

/**
 *
 * @author Pedro
 */
public class ResitenciaValidador implements ConstraintValidator<ResistenciaMinima, Double> {

    private double minimo;
    @Override
    public void initialize(ResistenciaMinima a) {
       this.minimo = a.min();
    }

    @Override
    public boolean isValid(Double value, ConstraintValidatorContext cvc) {
       return value>=this.minimo;
    }
    
    
}
