class AzureVaultKeyPairValidator implements ConstraintValidator<ValidAzureVaultKeyPair, AzureVaultKeyPair> {

    @Override
    public boolean isValid(final AzureVaultKeyPair keypair, final ConstraintValidatorContext cvc) {
        if (keypair == null) {
            return true;
        }

        return Objects.isNull(keypair.getPublicKeyVersion()) == Objects.isNull(keypair.getPrivateKeyVersion());
    }

}