Class PosDataCode
java.lang.Object
org.jpos.iso.PosFlags
org.jpos.iso.PosDataCode
- All Implemented Interfaces:
Loggeable
Represents POS Data Code flags as defined in jPOS/jCard specifications,
encoding reading method, verification method, POS environment, and security characteristics.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnumeration of POS terminal environment types.static enumEnumeration of card/data reading methods used at the POS terminal.static enumEnumeration of security characteristics for the transaction channel.static enumEnumeration of cardholder verification methods used at the POS terminal.Nested classes/interfaces inherited from class PosFlags
PosFlags.FlagModifier and TypeClassDescriptionstatic interfaceSingle flag identified by its byte offset and bit-mask withinPosFlags.getBytes(). -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.PosDataCode(int readingMethod, int verificationMethod, int posEnvironment, int securityCharacteristic) Constructs a PosDataCode with the given flag integers for each category. -
Method Summary
Modifier and TypeMethodDescriptionvoiddump(PrintStream p, String indent) Dumps a human-readable representation of this PosDataCode to the given stream.byte[]getBytes()Returns the raw 16-byte representation of this PosDataCode.booleanReturnstrueif the given POS environment is set.booleanhasPosEnvironments(int posEnvironments) Returnstrueif all specified POS environment bits are set.booleanReturnstrueif the given reading method is set.booleanhasReadingMethods(int readingMethods) Returnstrueif all specified reading method bits are set.booleanhasSecurityCharacteristic(PosDataCode.SecurityCharacteristic characteristic) Returnstrueif the given security characteristic is set.booleanhasSecurityCharacteristics(int securityCharacteristics) Returnstrueif all specified security characteristic bits are set.booleanReturnstrueif the given verification method is set.booleanhasVerificationMethods(int verificationMethods) Returnstrueif all specified verification method bits are set.booleanReturnstrueif the card was not physically present (e-commerce, manual entry, or recurring).booleanReturnstrueif the transaction is an e-commerce transaction.booleanisEMV()Returnstrueif the transaction used an EMV (ICC or contactless) reading method.booleanReturnstrueif the transaction used manual (physical) entry.booleanReturnstrueif the transaction is a recurring transaction.booleanisSwiped()Returnstrueif the transaction used magnetic stripe reading.voidsetPOSEnvironments(boolean value, PosDataCode.POSEnvironment... envs) Sets or clears one or more POS environment flags.voidSets one or more POS environment flags.voidsetReadingMethods(boolean value, PosDataCode.ReadingMethod... methods) Sets or clears one or more reading methods.voidsetReadingMethods(PosDataCode.ReadingMethod... methods) Sets one or more reading methods.voidsetSecurityCharacteristics(boolean value, PosDataCode.SecurityCharacteristic... securityCharacteristics) Sets or clears one or more security characteristic flags.voidSets one or more security characteristic flags.voidsetVerificationMethods(boolean value, PosDataCode.VerificationMethod... methods) Sets or clears one or more verification methods.voidsetVerificationMethods(PosDataCode.VerificationMethod... methods) Sets one or more verification methods.toString()voidClears one or more POS environment flags.voidunsetReadingMethods(PosDataCode.ReadingMethod... methods) Clears one or more reading methods.voidClears one or more security characteristic flags.voidClears one or more verification methods.static PosDataCodevalueOf(byte[] b) Creates a PosDataCode instance from a raw byte array.Methods inherited from class PosFlags
setFlagsModifier and TypeMethodDescriptionprotected voidsetFlags(boolean value, PosFlags.Flag... flags) Sets or unsets a set of flags according to valueMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Loggeable
dumpModifier and TypeMethodDescriptiondefault voiddump(PrintStream p, String indent, LogRenderer.Type type) Dumps a representation of this object using the specified renderer type.
-
Constructor Details
-
PosDataCode
public PosDataCode()Default constructor. -
PosDataCode
public PosDataCode(int readingMethod, int verificationMethod, int posEnvironment, int securityCharacteristic) Constructs a PosDataCode with the given flag integers for each category.- Parameters:
readingMethod- bitmask ofPosDataCode.ReadingMethodvaluesverificationMethod- bitmask ofPosDataCode.VerificationMethodvaluesposEnvironment- bitmask ofPosDataCode.POSEnvironmentvaluessecurityCharacteristic- bitmask ofPosDataCode.SecurityCharacteristicvalues
-
-
Method Details
-
hasReadingMethods
Returnstrueif all specified reading method bits are set.- Parameters:
readingMethods- bitmask of reading methods to test- Returns:
trueif all specified bits are set
-
hasReadingMethod
Returnstrueif the given reading method is set.- Parameters:
method- thePosDataCode.ReadingMethodto test- Returns:
trueif the reading method bit is set
-
hasVerificationMethods
Returnstrueif all specified verification method bits are set.- Parameters:
verificationMethods- bitmask of verification methods to test- Returns:
trueif all specified bits are set
-
hasVerificationMethod
Returnstrueif the given verification method is set.- Parameters:
method- thePosDataCode.VerificationMethodto test- Returns:
trueif the verification method bit is set
-
hasPosEnvironments
Returnstrueif all specified POS environment bits are set.- Parameters:
posEnvironments- bitmask of POS environments to test- Returns:
trueif all specified bits are set
-
hasPosEnvironment
Returnstrueif the given POS environment is set.- Parameters:
method- thePosDataCode.POSEnvironmentto test- Returns:
trueif the POS environment bit is set
-
hasSecurityCharacteristics
Returnstrueif all specified security characteristic bits are set.- Parameters:
securityCharacteristics- bitmask of security characteristics to test- Returns:
trueif all specified bits are set
-
hasSecurityCharacteristic
Returnstrueif the given security characteristic is set.- Parameters:
characteristic- thePosDataCode.SecurityCharacteristicto test- Returns:
trueif the security characteristic bit is set
-
getBytes
-
isEMV
Returnstrueif the transaction used an EMV (ICC or contactless) reading method.- Returns:
trueif ICC or contactless reading method is set
-
isManualEntry
Returnstrueif the transaction used manual (physical) entry.- Returns:
trueif physical reading method is set
-
isSwiped
Returnstrueif the transaction used magnetic stripe reading.- Returns:
trueif magnetic stripe reading method is set
-
isRecurring
Returnstrueif the transaction is a recurring transaction.- Returns:
trueif the recurring POS environment flag is set
-
isECommerce
Returnstrueif the transaction is an e-commerce transaction.- Returns:
trueif the e-commerce POS environment flag is set
-
isCardNotPresent
Returnstrueif the card was not physically present (e-commerce, manual entry, or recurring).- Returns:
trueif card-not-present conditions are detected
-
toString
-
valueOf
Creates a PosDataCode instance from a raw byte array.- Parameters:
b- source byte array- Returns:
- a new
PosDataCodeinitialized fromb
-
dump
Dumps a human-readable representation of this PosDataCode to the given stream. -
setReadingMethods
Sets or clears one or more reading methods.- Parameters:
value-trueto set,falseto clearmethods- the reading methods to modify
-
unsetReadingMethods
Clears one or more reading methods.- Parameters:
methods- the reading methods to clear
-
setReadingMethods
Sets one or more reading methods.- Parameters:
methods- the reading methods to set
-
setVerificationMethods
Sets or clears one or more verification methods.- Parameters:
value-trueto set,falseto clearmethods- 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
Sets or clears one or more POS environment flags.- Parameters:
value-trueto set,falseto clearenvs- 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-trueto set,falseto clearsecurityCharacteristics- 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
-