Class TextUtil
- java.lang.Object
-
- org.eclipse.jetty.websocket.common.util.TextUtil
-
@Deprecated(since="2021-05-27") public final class TextUtil extends java.lang.Object
Deprecated.The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.Collection of utility methods for Text content
-
-
Constructor Summary
Constructors Constructor Description TextUtil()
Deprecated.
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static java.lang.String
hint(java.lang.String text)
Deprecated.Create a hint of what the text is like.static java.lang.String
maxStringLength(int max, java.lang.String raw)
Deprecated.Smash a long string to fit within the max string length, by taking the middle section of the string and replacing them with an ellipsis "..."
-
-
-
Method Detail
-
hint
public static java.lang.String hint(java.lang.String text)
Deprecated.Create a hint of what the text is like.Used by logging and error messages to get a hint of what the text is like.
- Parameters:
text
- the text to abbreviate, quote, and generally give you a hint of what the value is.- Returns:
- the abbreviated text
-
maxStringLength
public static java.lang.String maxStringLength(int max, java.lang.String raw)
Deprecated.Smash a long string to fit within the max string length, by taking the middle section of the string and replacing them with an ellipsis "..."Examples: .maxStringLength( 9, "Eatagramovabits") == "Eat...its" .maxStringLength(10, "Eatagramovabits") == "Eat...bits" .maxStringLength(11, "Eatagramovabits") == "Eata...bits"
- Parameters:
max
- the maximum size of the string (minimum size supported is 9)raw
- the raw string to smash- Returns:
- the ellipsis'd version of the string.
-
-