Class StringUtil

java.lang.Object
swiss.trustbroker.common.util.StringUtil

public class StringUtil extends Object
  • Method Details

    • clean

      public static String clean(String dataToBeLogged)
      Parameters:
      dataToBeLogged -
      Returns:
      input with all newlines, carriage returns, and tabs replaced with underscores
    • clean

      public static String clean(String dataToBeLogged, String replace)
      Parameters:
      dataToBeLogged -
      replace - if null an undercore is used
      Returns:
      input with all newlines, carriage returns, and tabs replaced with replace
    • cleanForNameValue

      public static String cleanForNameValue(String dataToBeCleans)
      Parameters:
      dataToBeCleans -
      Returns:
      input with all unsafe characters replaced with a question mark
    • maskSecret

      public static String maskSecret(String secret)
      Parameters:
      secret -
      Returns:
      secret masked if not null
    • maskSecrets

      public static String maskSecrets(String value, String... secrets)
      Parameters:
      value -
      secrets -
      Returns:
      value with secrets masked
    • maskSecret

      public static String maskSecret(String key, String value)
      Parameters:
      key -
      value -
      Returns:
      value masked if key is sensitive