Interface TransactionKind

All Known Implementing Classes:
TransactionKind.Journey, TransactionKind.TopUp

public sealed interface TransactionKind permits TransactionKind.Journey, TransactionKind.TopUp
What a transaction record stands for, which byte 8 tells: a journey or a top up.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final record 
    A ride, paid out of the balance or free as a transfer.
    static final record 
    Money added to the balance.
  • Method Summary

    Modifier and Type
    Method
    Description
    ofValue(int value)
    The kind a byte stands for.
    int
    The byte the card stores.
  • Method Details

    • value

      int value()
      The byte the card stores.
      Returns:
      byte 8 of the record
    • ofValue

      static TransactionKind ofValue(int value)
      The kind a byte stands for.
      Parameters:
      value - byte 8 of a record
      Returns:
      the kind
      Throws:
      CardFormatException - if the byte is neither a direction nor a top up