Package org.apache.pinot.spi.utils
Class StringUtil
- java.lang.Object
-
- org.apache.pinot.spi.utils.StringUtil
-
public class StringUtil extends Object
-
-
Method Summary
Modifier and Type Method Description static Stringjoin(String separator, String... keys)Joins the given keys with the separator.static StringsanitizeStringValue(String value, int maxLength)Sanitizes a string value.static String[]split(String str, char separator, int max)Splits the given string with the separator, returns an array with the given max length.
-
-
-
Method Detail
-
join
public static String join(String separator, String... keys)
Joins the given keys with the separator.
-
split
public static String[] split(String str, char separator, int max)
Splits the given string with the separator, returns an array with the given max length. When max <= 0, no limit is applied.
-
sanitizeStringValue
public static String sanitizeStringValue(String value, int maxLength)
Sanitizes a string value.- Truncate characters after the first
nullcharacter as it is reserved as the padding character - Limit the length of the string
- Parameters:
value- String value to sanitizemaxLength- Max number of characters allowed- Returns:
- Modified value, or value itself if not modified
- Truncate characters after the first
-
-