{@inheritDoc} check if given string is a valid isbn.

@see javax.validation.ConstraintValidator#isValid(java.lang.Object,
javax.validation.ConstraintValidatorContext)
321928
@Override
  public final boolean isValid(final Object pvalue, final ConstraintValidatorContext pcontext) {
    final String valueAsString;
    if (ignoreSeparators) {
      valueAsString =
          Objects.toString(pvalue, StringUtils.EMPTY).replaceAll("-", StringUtils.EMPTY);
    } else {
      valueAsString = Objects.toString(pvalue, null);
    }
    if (StringUtils.isEmpty(valueAsString)) {
      return true;
    }
    if (!StringUtils.isNumeric(valueAsString)) {
      return false;
    }
    if (valueAsString.length() == Isbn10Validator.ISBN10_LENGTH) {
      // we do have 10 digits, lets test the checksum
      return CHECK_ISBN10.isValid(valueAsString);
    }
    if (valueAsString.length() == Isbn13Validator.ISBN13_LENGTH) {
      // we do have 13 digits, lets test the checksum
      return CHECK_ISBN13.isValid(valueAsString);
    }
    // other sizes are wrong, but this is reported by AlternateSize
    return true;
  }
1082184
private boolean isValidCharacters(final String component, final char padding) {
		// Check the component is either all padding chars or all digit chars
		boolean paddingChars = false;
		boolean digitChars = false;
		for (int i = 0; i < component.length(); i++) {
			char chr = component.charAt(i);
			// Padding
			if (chr == padding) {
				if (digitChars) {
					return false;
				}
				paddingChars = true;
			} else if (chr >= '0' && chr <= '9') {  // Digit
				if (paddingChars) {
					return false;
				}
				digitChars = true;
			} else {
				return false;
			}
		}

		return true;
	}
265090
public function isValid($value = null, array $options = []): bool
    {
        if (\count($options) > 0) {
            $this->setOptions($options);
        }
        $this->setValue($value);
        $this->errors = [];

        switch ($this->options['type']) {
            case 'isbn-10':
                $isValid = $this->validateIsbn10();
                break;
            case 'isbn-13':
                $isValid = $this->validateIsbn13();
                break;
            default:
                $isValid = $this->validateAuto();
                break;
        }
        return $isValid;
    }
159982
def valid?
      type_validator = EnumAttributeValidator.new('String', ["PICKUP"])
      return false unless type_validator.valid?(@type)
      state_validator = EnumAttributeValidator.new('String', ["PROPOSED", "RESERVED", "PREPARED", "COMPLETED", "CANCELED", "FAILED"])
      return false unless state_validator.valid?(@state)
      return true
    end
1356739
public static boolean isValid(String kontonummer) {
        try {
            KontonummerValidator.getKontonummer(kontonummer);
            return true;
        } catch (IllegalArgumentException e) {
            return false;
        }
    }
966745
@Override
  public final boolean isValid(final String pvalue, final ConstraintValidatorContext pcontext) {
    if (StringUtils.isEmpty(pvalue)) {
      return true;
    }
    if (pvalue.length() > LENGTH_MAIL) {
      // Email is to long, but that's handled by size annotation
      return true;
    }
    if (!StringUtils.equals(pvalue, StringUtils.trim(pvalue))) {
      // mail contains leading or trailing space(s), that's not correct
      return false;
    }
    return org.apache.commons.validator.routines.EmailValidator.getInstance().isValid(pvalue);
  }
821782
def valid?
      language_validator = EnumAttributeValidator.new('String', ["afts", "lucene", "cmis"])
      return false unless language_validator.valid?(@language)
      return false if @query.nil?
      return true
    end
888490
@Override
  public final boolean isValid(final Object pvalue, final ConstraintValidatorContext pcontext) {
    final String valueAsString;
    if (ignoreWhitspaces) {
      valueAsString =
          Objects.toString(pvalue, StringUtils.EMPTY).replaceAll("\\s+", StringUtils.EMPTY);
    } else {
      valueAsString = Objects.toString(pvalue, null);
    }
    if (StringUtils.isEmpty(valueAsString)) {
      // empty field is ok
      return true;
    }
    if (valueAsString.length() != BicValidator.BIC_LENGTH_MIN
        && valueAsString.length() != BicValidator.BIC_LENGTH_MAX) {
      // to short or to long, but it's handled by size validator!
      return true;
    }
    if (!valueAsString.matches(BicValidator.BIC_REGEX)) {
      // format is wrong!
      return false;
    }
    // final BicMapConstants BIC_MAP = CreateClass.create(BicMapConstants.class);
    return BIC_MAP.bics().containsKey(valueAsString) || BIC_MAP.bics()
        .containsKey(StringUtils.substring(valueAsString, 0, BicValidator.BIC_LENGTH_MIN));
  }
609090
@Override
	public boolean isValid(String value, ConstraintValidatorContext constraintContext) {

		// Si l'objet est null : false
		if(value == null) return matchOnEmpty;

		// Si l'objet n'est pas une chaine : false
		if(!(value instanceof String)) return false;
		
		// On caste
		String stringValue = (String) value;

		// Si la chaîne est vide : false
		if(stringValue == null || stringValue.length() == 0) return matchOnEmpty;
		
		// On retourne le matching
		return pattern.matcher(stringValue).matches();
	}
926236
public static function validate($isbn, $type = null)
    {
        if ($type !== null && !in_array($type, [10, 13], true)) {
            throw new \InvalidArgumentException('ISBN type option must be 10 or 13');
        }

        $isbn = str_replace(' ', '', $isbn);
        $isbn = str_replace('-', '', $isbn); // this is a dash
        $isbn = str_replace('‐', '', $isbn); // this is an authentic hyphen

        if ($type === 10) {
            return self::validateIsbn10($isbn);
        }
        if ($type === 13) {
            return self::validateIsbn13($isbn);
        }

        return self::validateIsbn10($isbn) || self::validateIsbn13($isbn);
    }
409230
public static boolean isInvalid(Object bean) {
		if (bean == null) {
			return false;
		}
		return isPrimitiveOrWrapper(bean.getClass()) 
				|| INVALID_TYPES.contains(bean.getClass())
				|| isInstanceOfInvalid(bean.getClass());
	}
455693
@Override
  public final boolean isValid(final Object pvalue, final ConstraintValidatorContext pcontext) {
    final String valueAsString = Objects.toString(pvalue, null);

    if (StringUtils.isEmpty(valueAsString)) {
      // empty field is ok
      return true;
    }
    return allowDin5008 && valueAsString.matches(PHONE_NUMBER_DIN5008) //
        || allowE123 && valueAsString.matches(PHONE_NUMBER_E123) //
        || allowUri && valueAsString.matches(PHONE_NUMBER_URI) //
        || allowMs && valueAsString.matches(PHONE_NUMBER_MS) //
        || allowCommon && valueAsString.matches(PHONE_NUMBER_COMMON);
  }
1329052
public function isValidIsbn(string $isbn) : bool
    {
        return $this->isValidIsbn10($isbn) || $this->isValidIsbn13($isbn);
    }
336499
@Override
    public boolean isValid(String value, ConstraintValidatorContext context) {
        try {
            this.duracloudUserService.checkUsername(value);
        } catch (InvalidUsernameException ex) {
            context.disableDefaultConstraintViolation();
            String message;
            if (ex instanceof ReservedUsernameException) {
                message = RESERVED_USERNAME_MESSAGE;
            } else if (ex instanceof ReservedPrefixException) {
                message = RESERVED_PREFIX_MESSAGE;
            } else {
                message = INVALID_USERNAME_MESSAGE;
            }

            message = MessageFormat.format(message, value);
            ConstraintViolationBuilder cvb =
                context.buildConstraintViolationWithTemplate(message);
            cvb.addConstraintViolation();
            return false;
        } catch (UserAlreadyExistsException ex) {
            return false;
        }

        return true;
    }
351226
@Override
  public final boolean isValid(final Object pvalue, final ConstraintValidatorContext pcontext) {
    final String valueAsString = Objects.toString(pvalue, null);
    if (StringUtils.isEmpty(valueAsString)) {
      return true;
    }
    if (valueAsString.length() != ISIN_LENGTH) {
      // ISIN size is wrong, but that's handled by size annotation
      return true;
    }
    // calculate and check checksum (ISIN)
    return CHECK_ISIN.isValid(valueAsString);
  }
1259475
@Override
  public final boolean isValid(final Object pvalue, final ConstraintValidatorContext pcontext) {
    if (pvalue == null) {
      return true;
    }
    try {
      final String fieldCheckValue =
          BeanPropertyReaderUtil.getNullSaveStringProperty(pvalue, fieldCheckName);
      final String fieldCompareValue =
          BeanPropertyReaderUtil.getNullSaveStringProperty(pvalue, fieldCompareName);
      if (StringUtils.isNotEmpty(fieldCheckValue)
          && StringUtils.equals(valueCompare, fieldCompareValue)) {
        switchContext(pcontext);
        return false;
      }
      return true;
    } catch (final Exception ignore) {
      switchContext(pcontext);
      return false;
    }
  }
1033073
@Override
  public final boolean isValid(final String pvalue, final ConstraintValidatorContext pcontext) {
    if (StringUtils.isEmpty(pvalue)) {
      return true;
    }
    if (pvalue.length() > LENGTH_CREDIT_CARDNUMBER) {
      // credit card number is to long, but that's handled by size annotation
      return true;
    }
    return CHECK_CREDIT_CARD.isValid(pvalue);
  }