Class PosDataCode

java.lang.Object
org.jpos.iso.PosFlags
org.jpos.iso.PosDataCode
All Implemented Interfaces:
Loggeable

public class PosDataCode extends PosFlags implements Loggeable
Represents POS Data Code flags as defined in jPOS/jCard specifications, encoding reading method, verification method, POS environment, and security characteristics.
  • Constructor Details

  • Method Details

    • hasReadingMethods

      public boolean hasReadingMethods(int readingMethods)
      Returns true if all specified reading method bits are set.
      Parameters:
      readingMethods - bitmask of reading methods to test
      Returns:
      true if all specified bits are set
    • hasReadingMethod

      Returns true if the given reading method is set.
      Parameters:
      method - the PosDataCode.ReadingMethod to test
      Returns:
      true if the reading method bit is set
    • hasVerificationMethods

      public boolean hasVerificationMethods(int verificationMethods)
      Returns true if all specified verification method bits are set.
      Parameters:
      verificationMethods - bitmask of verification methods to test
      Returns:
      true if all specified bits are set
    • hasVerificationMethod

      Returns true if the given verification method is set.
      Parameters:
      method - the PosDataCode.VerificationMethod to test
      Returns:
      true if the verification method bit is set
    • hasPosEnvironments

      public boolean hasPosEnvironments(int posEnvironments)
      Returns true if all specified POS environment bits are set.
      Parameters:
      posEnvironments - bitmask of POS environments to test
      Returns:
      true if all specified bits are set
    • hasPosEnvironment

      Returns true if the given POS environment is set.
      Parameters:
      method - the PosDataCode.POSEnvironment to test
      Returns:
      true if the POS environment bit is set
    • hasSecurityCharacteristics

      public boolean hasSecurityCharacteristics(int securityCharacteristics)
      Returns true if all specified security characteristic bits are set.
      Parameters:
      securityCharacteristics - bitmask of security characteristics to test
      Returns:
      true if all specified bits are set
    • hasSecurityCharacteristic

      Returns true if the given security characteristic is set.
      Parameters:
      characteristic - the PosDataCode.SecurityCharacteristic to test
      Returns:
      true if the security characteristic bit is set
    • getBytes

      public byte[] getBytes()
      Returns the raw 16-byte representation of this PosDataCode.
      Specified by:
      getBytes in class PosFlags
      Returns:
      byte array holding all POS data code flags
    • isEMV

      public boolean isEMV()
      Returns true if the transaction used an EMV (ICC or contactless) reading method.
      Returns:
      true if ICC or contactless reading method is set
    • isManualEntry

      public boolean isManualEntry()
      Returns true if the transaction used manual (physical) entry.
      Returns:
      true if physical reading method is set
    • isSwiped

      public boolean isSwiped()
      Returns true if the transaction used magnetic stripe reading.
      Returns:
      true if magnetic stripe reading method is set
    • isRecurring

      public boolean isRecurring()
      Returns true if the transaction is a recurring transaction.
      Returns:
      true if the recurring POS environment flag is set
    • isECommerce

      public boolean isECommerce()
      Returns true if the transaction is an e-commerce transaction.
      Returns:
      true if the e-commerce POS environment flag is set
    • isCardNotPresent

      public boolean isCardNotPresent()
      Returns true if the card was not physically present (e-commerce, manual entry, or recurring).
      Returns:
      true if card-not-present conditions are detected
    • toString

      public String toString()
      Overrides:
      toString in class PosFlags
    • valueOf

      public static PosDataCode valueOf(byte[] b)
      Creates a PosDataCode instance from a raw byte array.
      Parameters:
      b - source byte array
      Returns:
      a new PosDataCode initialized from b
    • dump

      public void dump(PrintStream p, String indent)
      Dumps a human-readable representation of this PosDataCode to the given stream.
      Specified by:
      dump in interface Loggeable
      Parameters:
      p - the output stream
      indent - indentation prefix string
    • setReadingMethods

      public void setReadingMethods(boolean value, PosDataCode.ReadingMethod... methods)
      Sets or clears one or more reading methods.
      Parameters:
      value - true to set, false to clear
      methods - the reading methods to modify
    • unsetReadingMethods

      Clears one or more reading methods.
      Parameters:
      methods - the reading methods to clear
    • setReadingMethods

      public void setReadingMethods(PosDataCode.ReadingMethod... methods)
      Sets one or more reading methods.
      Parameters:
      methods - the reading methods to set
    • setVerificationMethods

      public void setVerificationMethods(boolean value, PosDataCode.VerificationMethod... methods)
      Sets or clears one or more verification methods.
      Parameters:
      value - true to set, false to clear
      methods - the verification methods to modify
    • unsetVerificationMethods

      Clears one or more verification methods.
      Parameters:
      methods - the verification methods to clear
    • setVerificationMethods

      Sets one or more verification methods.
      Parameters:
      methods - the verification methods to set
    • setPOSEnvironments

      public void setPOSEnvironments(boolean value, PosDataCode.POSEnvironment... envs)
      Sets or clears one or more POS environment flags.
      Parameters:
      value - true to set, false to clear
      envs - the POS environments to modify
    • unsetPOSEnvironments

      Clears one or more POS environment flags.
      Parameters:
      envs - the POS environments to clear
    • setPOSEnvironments

      Sets one or more POS environment flags.
      Parameters:
      envs - the POS environments to set
    • setSecurityCharacteristics

      public void setSecurityCharacteristics(boolean value, PosDataCode.SecurityCharacteristic... securityCharacteristics)
      Sets or clears one or more security characteristic flags.
      Parameters:
      value - true to set, false to clear
      securityCharacteristics - the security characteristics to modify
    • unsetSecurityCharacteristics

      Clears one or more security characteristic flags.
      Parameters:
      envs - the security characteristics to clear
    • setSecurityCharacteristics

      Sets one or more security characteristic flags.
      Parameters:
      envs - the security characteristics to set