code: @Override
    public final boolean isValid(final Object pvalue, final ConstraintValidatorContext pcontext) {
      String valueAsString = Objects.toString(pvalue, StringUtils.EMPTY);
      if (StringUtils.isEmpty(valueAsString)) {
        return true;
      }
      if (ignoreWhiteSpaces) {
        valueAsString = valueAsString.replaceAll("\\s", StringUtils.EMPTY);
      }
      if (ignoreMinus) {
        valueAsString = valueAsString.replaceAll("-", StringUtils.EMPTY);
      }
      if (ignoreSlashes) {
        valueAsString = valueAsString.replaceAll("/", StringUtils.EMPTY);
      }
      return StringUtils.length(valueAsString) == size1 || StringUtils.length(valueAsString) == size2;
    }
docs: {@inheritDoc} check if given object is valid.
  
  @see javax.validation.ConstraintValidator#isValid(Object,
  javax.validation.ConstraintValidatorContext)