public class PrintHelper
extends java.lang.Object
Provides dumper/printer helper methods.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_MASK_CHAR
The default mask char which is used to mask a sensitive string
|
static int |
DEFAULT_PLAIN_LENGTH
The default plain part length which is used to mask a sensitive string
|
Constructor and Description |
---|
PrintHelper() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
convertAvsCodeToString(int avsCode)
Converts an AVS code into a non-localized human-readable string.
|
static java.lang.String |
convertPhaseToString(int phase)
Converts a phase int into a non-localized human-readable phase.
|
static java.lang.String |
convertStatusAsString(int status)
Returns the status in a non-localized human readable format.
|
static java.lang.String |
dumpArray(java.lang.Object[] array)
Converts a Java built-in array of any type into a
String . |
static java.lang.String |
dumpMapWithMasking(java.util.Map map,
boolean mask)
Dumps a map to a string with or without masking option.
|
static java.lang.String |
mask100PercentOfSensitiveString(java.lang.String plainText)
Masks the complete plain text string.
|
static java.lang.String |
mask70PercentOfSensitiveString(java.lang.String plainText)
Masks 70 percent of the plain text string.
|
static java.lang.String |
maskSensitiveString(java.lang.String plainText)
Mark the sensitive string type protocol data using the default configuration: maskChar = ""
and plainLength = -4
|
static java.lang.String |
maskSensitiveString(java.lang.String plainText,
java.lang.String maskChar,
int plainLength)
Mark the sensitive string type protocol data
|
public static final java.lang.String DEFAULT_MASK_CHAR
public static final int DEFAULT_PLAIN_LENGTH
public static java.lang.String convertAvsCodeToString(int avsCode)
avsCode
- the AVS codepublic static java.lang.String convertPhaseToString(int phase)
phase
- the EDP request phasepublic static java.lang.String convertStatusAsString(int status)
status
- the statuspublic static java.lang.String dumpArray(java.lang.Object[] array)
Converts a Java built-in array of any type into a String
.
toString
is invoked in all the elements of the array.
array
- the array to be converted into String
String
representing the arraypublic static java.lang.String dumpMapWithMasking(java.util.Map map, boolean mask)
map
- the map to be dumped into a human-readable stringmask
- if the string is to be masked or notpublic static java.lang.String mask100PercentOfSensitiveString(java.lang.String plainText)
plainText
- the plain text stringpublic static java.lang.String mask70PercentOfSensitiveString(java.lang.String plainText)
plainText
- the plain text stringpublic static java.lang.String maskSensitiveString(java.lang.String plainText, java.lang.String maskChar, int plainLength)
plainText
- the plain text without maskmaskChar
- the char used to mark the stringplainLength
- the length of the plain text after masking the string.public static java.lang.String maskSensitiveString(java.lang.String plainText)
plainText
- the plain text without mask