Class StringUtils

java.lang.Object
io.opentelemetry.instrumentation.api.internal.StringUtils

public final class StringUtils extends Object
Internal string utilities.

This class is internal and is hence not for public use. Its APIs are unstable and can change at any time.

  • Method Details

    • truncate

      public static String truncate(String value, int maxLength)
      Returns the longest prefix whose String.length() does not exceed maxLength. If truncating at the limit would split a surrogate pair, the pair is omitted.
    • truncate

      public static void truncate(StringBuilder value, int maxLength)
      Truncates value so that its length does not exceed maxLength. If the limit would split a surrogate pair, the pair is omitted.
    • truncate

      public static void truncate(StringBuffer value, int maxLength)
      Truncates value so that its length does not exceed maxLength. If the limit would split a surrogate pair, the pair is omitted.
    • appendTruncated

      public static void appendTruncated(StringBuilder target, String value, int maxLength)
      Appends the longest prefix of value whose length does not exceed maxLength. If the limit would split a surrogate pair, the pair is omitted.