com.ibm.commerce.edp.utils

Class PrintHelper

  • java.lang.Object
    • com.ibm.commerce.edp.utils.PrintHelper


  • public class PrintHelper
    extends java.lang.Object

    Provides dumper/printer helper methods.

    • Field Summary

      Fields 
      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 Summary

      Constructors 
      Constructor and Description
      PrintHelper() 
    • Method Summary

      All Methods Static Methods Concrete Methods 
      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
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • DEFAULT_MASK_CHAR

        public static final java.lang.String DEFAULT_MASK_CHAR
        The default mask char which is used to mask a sensitive string
        See Also:
        Constant Field Values
      • DEFAULT_PLAIN_LENGTH

        public static final int DEFAULT_PLAIN_LENGTH
        The default plain part length which is used to mask a sensitive string
        See Also:
        Constant Field Values
    • Constructor Detail

      • PrintHelper

        public PrintHelper()
    • Method Detail

      • convertAvsCodeToString

        public static java.lang.String convertAvsCodeToString(int avsCode)
        Converts an AVS code into a non-localized human-readable string.
        Parameters:
        avsCode - the AVS code
        Returns:
        non-localized human-readable string representation of the AVS code
      • convertPhaseToString

        public static java.lang.String convertPhaseToString(int phase)
        Converts a phase int into a non-localized human-readable phase.
        Parameters:
        phase - the EDP request phase
        Returns:
        the non-localized human-readable phase
      • convertStatusAsString

        public static java.lang.String convertStatusAsString(int status)
        Returns the status in a non-localized human readable format.
        Parameters:
        status - the status
        Returns:
        the status in a non-localized human readable format
      • dumpArray

        public 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.

        Parameters:
        array - the array to be converted into String
        Returns:
        the String representing the array
      • dumpMapWithMasking

        public static java.lang.String dumpMapWithMasking(java.util.Map map,
                                                          boolean mask)
        Dumps a map to a string with or without masking option.
        Parameters:
        map - the map to be dumped into a human-readable string
        mask - if the string is to be masked or not
        Returns:
        a human-readable string with the contents of a map
      • mask100PercentOfSensitiveString

        public static java.lang.String mask100PercentOfSensitiveString(java.lang.String plainText)
        Masks the complete plain text string.
        Parameters:
        plainText - the plain text string
        Returns:
        the masked string
      • mask70PercentOfSensitiveString

        public static java.lang.String mask70PercentOfSensitiveString(java.lang.String plainText)
        Masks 70 percent of the plain text string.
        Parameters:
        plainText - the plain text string
        Returns:
        the masked string
      • maskSensitiveString

        public static java.lang.String maskSensitiveString(java.lang.String plainText,
                                                           java.lang.String maskChar,
                                                           int plainLength)
        Mark the sensitive string type protocol data
        Parameters:
        plainText - the plain text without mask
        maskChar - the char used to mark the string
        plainLength - the length of the plain text after masking the string.
        Returns:
        the masked text
      • maskSensitiveString

        public static java.lang.String maskSensitiveString(java.lang.String plainText)
        Mark the sensitive string type protocol data using the default configuration: maskChar = "" and plainLength = -4
        Parameters:
        plainText - the plain text without mask
        Returns:
        the masked text