Enum ISBN.Type

  • All Implemented Interfaces:
    Serializable, Comparable<ISBN.Type>
    Enclosing class:
    ISBN

    public static enum ISBN.Type
    extends Enum<ISBN.Type>
    Defines the ISBN length. Valid lengths of ISBNs are 10 and 13 which are represented as ISBN_10 and ISBN_13 respectively.

    Using ANY allows to validate values that could either be ISBN10 or ISBN13. In such case, ISBN type would be determined by the length of the corresponding value.

    • Enum Constant Detail

      • ISBN_10

        public static final ISBN.Type ISBN_10
      • ISBN_13

        public static final ISBN.Type ISBN_13
    • Method Detail

      • values

        public static ISBN.Type[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (ISBN.Type c : ISBN.Type.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static ISBN.Type valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null