package com.dbs.consentServer.constraint.demo;

import java.util.Optional;

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

import com.dbs.consentServer.constraint.IUserValidate;

public class UserValidateImpl implements ConstraintValidator<IUserValidate, String> {
  @Override
  public boolean isValid(String value, ConstraintValidatorContext context) {
    if(value.length() < 3){
      return false;
    }
    return true;
    // return Optional.ofNullable(value).map(d -> !d.isEmpty()).orElse(false);
  } 
}