Enum UpcEanExtensionBehavior

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<UpcEanExtensionBehavior>

    public enum UpcEanExtensionBehavior
    extends java.lang.Enum<UpcEanExtensionBehavior>
    Behavior when scanning UPC/EAN barcodes with EAN-2 or EAN-5 extensions.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      ALLOW_2
      Return detected 2-digit extension if present, but do not require it.
      ALLOW_5
      Return detected 5-digit extension if present, but do not require it.
      ALLOW_ANY
      Return any detected extension if present, but do not require it.
      IGNORE
      Always ignore the extension.
      REQUIRE_2
      Only barcodes with a 2-digit extension are accepted.
      REQUIRE_5
      Only barcodes with a 5-digit extension are accepted.
      REQUIRE_ANY
      Only barcodes with either a 2-digit or a 5-digit extension are accepted.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static UpcEanExtensionBehavior valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static UpcEanExtensionBehavior[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • REQUIRE_2

        public static final UpcEanExtensionBehavior REQUIRE_2
        Only barcodes with a 2-digit extension are accepted.
      • REQUIRE_5

        public static final UpcEanExtensionBehavior REQUIRE_5
        Only barcodes with a 5-digit extension are accepted.
      • REQUIRE_ANY

        public static final UpcEanExtensionBehavior REQUIRE_ANY
        Only barcodes with either a 2-digit or a 5-digit extension are accepted.
      • ALLOW_2

        public static final UpcEanExtensionBehavior ALLOW_2
        Return detected 2-digit extension if present, but do not require it. Ignore the 5-digit extension.
      • ALLOW_5

        public static final UpcEanExtensionBehavior ALLOW_5
        Return detected 5-digit extension if present, but do not require it. Ignore the 2-digit extension.
      • ALLOW_ANY

        public static final UpcEanExtensionBehavior ALLOW_ANY
        Return any detected extension if present, but do not require it.
    • Method Detail

      • values

        public static UpcEanExtensionBehavior[] 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 (UpcEanExtensionBehavior c : UpcEanExtensionBehavior.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static UpcEanExtensionBehavior valueOf​(java.lang.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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null