Class StringUtils
java.lang.Object
io.opentelemetry.api.internal.StringUtils
Utilities for working with strings.
This class is internal and is hence not for public use. Its APIs are unstable and can change at any time.
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisNullOrEmpty(String string) Returnstrueif the given string is null or is the empty string.static booleanisPrintableString(String str) Determines whether theStringcontains only printable characters.static StringPads a given string on the left with leading 0's up the length.
-
Method Details
-
isNullOrEmpty
Returnstrueif the given string is null or is the empty string.This method was copied verbatim from Guava library method com.google.common.base.Strings#isNullOrEmpty(java.lang.String).
- Parameters:
string- a string reference to check- Returns:
trueif the string is null or is the empty string
-
padLeft
Pads a given string on the left with leading 0's up the length.- Parameters:
value- the string to padminLength- the minimum length the resulting padded string must have. Can be zero or negative, in which case the input string is always returned.- Returns:
- the padded string
-
isPrintableString
Determines whether theStringcontains only printable characters.- Parameters:
str- theStringto be validated.- Returns:
- whether the
Stringcontains only printable characters.
-