public class StringTools extends Object
Constructor and Description |
---|
StringTools() |
Modifier and Type | Method and Description |
---|---|
static String |
encryptCredentials(String originalText,
Pattern pattern,
CryptoScheme cryptoScheme)
Encrypts credentials in a given String
|
static String |
formatFileName(String name)
Formats a filename by replacing timestamp and placeholders with proper values.
|
static String |
getMapFormatString(Collection<String> keyList)
Returns a map format string (
getMapFormatString(java.util.Collection, char) )
with divider defaulting to ':' |
static String |
getMapFormatString(Collection<String> keys,
char divider)
Returns a format string for generating a left-aligned two-column name-value map
|
static String |
growString(char character,
int length)
Creates a String of given length using the given character
|
static String |
maskCredentials(String originalText,
Pattern pattern)
Masks credentials in a given String
|
public static String getMapFormatString(Collection<String> keys, char divider)
keys
- key collection of the map to be formatteddivider
- character used as column dividerpublic static String getMapFormatString(Collection<String> keyList)
getMapFormatString(java.util.Collection, char)
)
with divider defaulting to ':'keyList
- key collection of the map to be formattedpublic static String growString(char character, int length)
character
- character to be usedlength
- length of required Stringpublic static String maskCredentials(String originalText, Pattern pattern)
originalText
- String within which masking should be performedpattern
- compiled regular expression for matching contentpublic static String encryptCredentials(String originalText, Pattern pattern, CryptoScheme cryptoScheme)
originalText
- String within which encryption should be performedpattern
- compiled regular expression for matching contentcryptoScheme
- cryptographic scheme for encryptionpublic static String formatFileName(String name)
TBSRConstants.TIMESTAMP_HOLDER
name
- filename to be formattedCopyright © 2016–2019 AdroitLogic. All rights reserved.