Enum Class Chip

java.lang.Object
java.lang.Enum<Chip>
dev.hloth.zgztransport.Chip
All Implemented Interfaces:
Serializable, Comparable<Chip>, Constable

public enum Chip extends Enum<Chip>
A MIFARE Classic variant one of these cards is built on.
  • Enum Constant Details

    • CLASSIC_1K

      public static final Chip CLASSIC_1K
      MIFARE Classic 1K, which the Avanza cards use.
    • CLASSIC_4K

      public static final Chip CLASSIC_4K
      MIFARE Classic 4K, which the Lazo card uses.
  • Method Details

    • values

      public static Chip[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Chip valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null
    • uidLength

      public int uidLength()
      Bytes the UID of this chip takes in block 0.
      Returns:
      the length
    • blocks

      public int blocks()
      Blocks a card with this chip has.
      Returns:
      the block count
    • sectors

      public int sectors()
      Sectors a card with this chip has.
      Returns:
      the sector count
    • ofUidLength

      public static Optional<Chip> ofUidLength(int uidLength)
      The chip whose UID takes that many bytes.
      Parameters:
      uidLength - the length of a UID
      Returns:
      the chip, or empty when no chip has UIDs of that length