/* * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template */ package com.megatim.fdxgenerator.annotations; import com.megatim.fdxgenerator.model.FichierValidation; import javax.validation.ConstraintValidator; import javax.validation.ConstraintValidatorContext; /** * * @author STEPHANIE */ public class KeyToDecryptValidator implements ConstraintValidator{ @Override public boolean isValid(FichierValidation t, ConstraintValidatorContext cvc) { if(t.isProtege()) return t.getKeyToEncrypt() != null && !t.getKeyToEncrypt().isEmpty() && t.getKeyToEncrypt().equals(t.getKeyConfirmation()); else return true; } }