Package io.sentry.util
Class StringUtils
- java.lang.Object
-
- io.sentry.util.StringUtils
-
@Internal public final class StringUtils extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static @NotNull java.lang.String
byteCountToString(long bytes)
Converts the given number of bytes to a human-readable string.static @Nullable java.lang.String
calculateStringHash(@Nullable java.lang.String str, @NotNull ILogger logger)
Calculates the SHA-1 String hashstatic @Nullable java.lang.String
capitalize(@Nullable java.lang.String str)
Returns a Capitalized String and all remaining chars to lower case.static @Nullable java.lang.String
getStringAfterDot(@Nullable java.lang.String str)
static @Nullable java.lang.String
removeSurrounding(@Nullable java.lang.String str, @Nullable java.lang.String delimiter)
Removes character specified by the delimiter parameter from the beginning and the end of the string.
-
-
-
Method Detail
-
getStringAfterDot
@Nullable public static @Nullable java.lang.String getStringAfterDot(@Nullable @Nullable java.lang.String str)
-
capitalize
@Nullable public static @Nullable java.lang.String capitalize(@Nullable @Nullable java.lang.String str)
Returns a Capitalized String and all remaining chars to lower case. eg seSSioN = Session- Parameters:
str
- the String to capitalize- Returns:
- the capitalized String or itself if empty or null
-
removeSurrounding
@Nullable public static @Nullable java.lang.String removeSurrounding(@Nullable @Nullable java.lang.String str, @Nullable @Nullable java.lang.String delimiter)
Removes character specified by the delimiter parameter from the beginning and the end of the string.- Parameters:
str
- the String to remove surrounding string fromdelimiter
- the String that is meant to be removed- Returns:
- a string without delimiter character at the beginning and the end of the string
-
byteCountToString
@NotNull public static @NotNull java.lang.String byteCountToString(long bytes)
Converts the given number of bytes to a human-readable string.- Parameters:
bytes
- the number of bytes- Returns:
- a string representing the human-readable byte count (e.g. 1kB, 20 MB, etc.)
-
calculateStringHash
@Nullable public static @Nullable java.lang.String calculateStringHash(@Nullable @Nullable java.lang.String str, @NotNull @NotNull ILogger logger)
Calculates the SHA-1 String hash- Parameters:
str
- the Stringlogger
- the Logger- Returns:
- The hashed String or null otherwise
-
-