Package com.atlan.util
Class StringUtils
java.lang.Object
com.atlan.util.StringUtils
Utilities for working with strings.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic booleancontainsWhitespace(String str) Checks whether a string contains any whitespace characters or not.static StringdecodeContent(String encoded) Decode the provided content from the README-encoded form to plain HTML.static StringencodeContent(String decoded) Encode the provided content for storage as a README's content.static StringgetConnectionQualifiedName(String qualifiedName) Retrieve the connection's qualifiedName from the provided asset qualifiedName.static StringgetFieldNameFromMethodName(String methodName) Determine the name of a field that's read or written by a getter/setter method, from the name of the method.static StringgetLowerCamelCase(String text) Convert the provided string to lowerCamelCase, leaving alone consecutive capital letters.static StringConvert the provided string to lowerCamelCase, aggressively lowercasing consecutive capital letters.static StringgetLowerSnakeCase(String text) Convert the provided string to lower_snake_case.static StringgetNameFromQualifiedName(String qualifiedName) Retrieve the name of a data asset from the provided qualifiedName.static StringgetNameFromQualifiedName(String qualifiedName, String delimiter) Retrieve the name of a data asset from the provided qualifiedName.static StringgetParentQualifiedNameFromQualifiedName(String qualifiedName) Retrieve the qualifiedName of the parent data asset of the provided asset's qualifiedName.static StringgetParentQualifiedNameFromQualifiedName(String qualifiedName, String delimiter) Retrieve the qualifiedName of the parent data asset of the provided asset's qualifiedName.static StringgetSuperDomainQualifiedName(String domainQualifiedName) Retrieve the domain's top-most ancestral domain qualifiedName.static StringgetTitleCase(String text) Convert the provided string to Title Case.static StringgetUpperCamelCase(String text) Convert the provided string into UpperCamelCase.static StringgetUpperSnakeCase(String text) Convert the provided string to UPPER_SNAKE_CASE.static booleanChecks whether a string is a valid UUID(v4) or not.static booleanChecks whether a string is a valid connection qualifiedName or not.static booleansecureCompare(String a, String b) Compares two strings for equality.static StringtrimPathDelimiters(String toTrim) Remove any leading and trailing /-slashes from the provided string.
- 
Constructor Details- 
StringUtilspublic StringUtils()
 
- 
- 
Method Details- 
containsWhitespaceChecks whether a string contains any whitespace characters or not.- Parameters:
- str- the string to check.
- Returns:
- trueif the string contains any whitespace characters; otherwise,- false.
 
- 
secureCompareCompares two strings for equality. The time taken is independent of the number of characters that match.- Parameters:
- a- one of the strings to compare.
- b- the other string to compare.
- Returns:
- true if the strings are equal, false otherwise.
 
- 
getFieldNameFromMethodNameDetermine the name of a field that's read or written by a getter/setter method, from the name of the method.- Parameters:
- methodName- from which to reverse-engineer the field name
- Returns:
- the field name
 
- 
encodeContentEncode the provided content for storage as a README's content.- Parameters:
- decoded- to be encoded
- Returns:
- encoded README content
 
- 
decodeContentDecode the provided content from the README-encoded form to plain HTML.- Parameters:
- encoded- to be decoded
- Returns:
- decoded README content (HTML)
 
- 
getConnectionQualifiedNameRetrieve the connection's qualifiedName from the provided asset qualifiedName. Note that this will also return null if the qualifiedName provided is for a connection (only) already!- Parameters:
- qualifiedName- of the asset, from which to retrieve the connection's qualifiedName
- Returns:
- the qualifiedName of the connection, or null if none can be determined
 
- 
getSuperDomainQualifiedNameRetrieve the domain's top-most ancestral domain qualifiedName.- Parameters:
- domainQualifiedName- of the domain, from which to retrieve the top-most ancestral domain qualifiedName
- Returns:
- the qualifiedName of the top-most ancestral domain, or null if none can be determined
 
- 
getNameFromQualifiedNameRetrieve the name of a data asset from the provided qualifiedName.- Parameters:
- qualifiedName- from which to retrieve the name component
- Returns:
- the name of the data asset
 
- 
getNameFromQualifiedNameRetrieve the name of a data asset from the provided qualifiedName.- Parameters:
- qualifiedName- from which to retrieve the name component
- delimiter- by which the (non-connection) components of the qualifiedName are separated
- Returns:
- the name of the data asset
 
- 
getParentQualifiedNameFromQualifiedNameRetrieve the qualifiedName of the parent data asset of the provided asset's qualifiedName.- Parameters:
- qualifiedName- from which to retrieve the parent asset's qualifiedName
- Returns:
- the qualifiedName of the parent data asset
 
- 
getParentQualifiedNameFromQualifiedNamepublic static String getParentQualifiedNameFromQualifiedName(String qualifiedName, String delimiter) Retrieve the qualifiedName of the parent data asset of the provided asset's qualifiedName.- Parameters:
- qualifiedName- from which to retrieve the parent asset's qualifiedName
- delimiter- by which the (non-connection) components of the qualifiedName are separated
- Returns:
- the qualifiedName of the parent data asset
 
- 
trimPathDelimitersRemove any leading and trailing /-slashes from the provided string.- Parameters:
- toTrim- the string to trim
- Returns:
- the string, without any leading or trailing / (if any)
 
- 
isUUIDChecks whether a string is a valid UUID(v4) or not.- Parameters:
- str- the string to check.
- Returns:
- trueif the string is a valid UUID(v4); otherwise,- false.
 
- 
isValidConnectionQNChecks whether a string is a valid connection qualifiedName or not.- Parameters:
- qn- the string to check.
- Returns:
- trueif the string is a valid connection qualifiedName; otherwise,- false.
 
- 
getUpperCamelCaseConvert the provided string into UpperCamelCase.- Parameters:
- text- to convert
- Returns:
- the original text, in UpperCamelCase
 
- 
getLowerCamelCaseConvert the provided string to lowerCamelCase, leaving alone consecutive capital letters. For example: "MySQLDatabase" turns into "mySQLDatabase"- Parameters:
- text- to convert
- Returns:
- the original text, in lowerCamelCase
 
- 
getLowerCamelCaseAggressiveConvert the provided string to lowerCamelCase, aggressively lowercasing consecutive capital letters. For example: "MySQLDatabase" turns into "mysqldatabase"- Parameters:
- text- to convert
- Returns:
- the original text, in lowerCamelCase
 
- 
getUpperSnakeCaseConvert the provided string to UPPER_SNAKE_CASE.- Parameters:
- text- to convert
- Returns:
- the original text, in UPPER_SNAKE_CASE
 
- 
getLowerSnakeCaseConvert the provided string to lower_snake_case.- Parameters:
- text- to convert
- Returns:
- the original text, in lower_snake_case
 
- 
getTitleCaseConvert the provided string to Title Case.- Parameters:
- text- to convert
- Returns:
- the original text, in Title Case
 
 
-