Class ISBNValidator
java.lang.Object
de.creativecouple.validation.isbn.ISBNValidator
The ISBNValidator class represents a combination of rules for the desired ISBN length (10 or 13) and hyphenation
style (any, none, correct, correct-or-none), for checking input strings.
E.g.
E.g.
myValidator = ISBNValidator.isbn13().hyphenation(NONE) to validate compact ISBN-13 string only.- Author:
- Peter Liske (CreativeCouple)
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic ISBNValidatorBuilderanyIsbn()booleaninthashCode()static ISBNValidatorBuilderisbn10()static ISBNValidatorBuilderisbn13()Parses a given string input and returns an ISBN object, if it matches this validator's criteria.booleanChecks whether a given string passes this validator's criteria.
-
Method Details
-
test
Checks whether a given string passes this validator's criteria. -
equals
-
hashCode
public int hashCode() -
parse
Parses a given string input and returns an ISBN object, if it matches this validator's criteria.- Returns:
- the ISBN object
- Throws:
IllegalArgumentException- if the input is invalid according to this validator
-
anyIsbn
- Returns:
- a builder object for validating both ISBN-10 and ISBN-13 strings
-
isbn10
- Returns:
- a builder object for validating ISBN-10 strings only
-
isbn13
- Returns:
- a builder object for validating ISBN-13 strings only
-