Top Description Constructors Methods
org.eclipse.jetty.websocket.core.util

public final Class TextUtils

extends Object
Class Inheritance

Collection of utility methods for Text content

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static String

Returns:

the abbreviated text
hint
(String
the text to abbreviate, quote, and generally give you a hint of what the value is.
text
)

Create a hint of what the text is like.

public static String

Returns:

the ellipsis'd version of the string.
maxStringLength
(int
the maximum size of the string (minimum size supported is 9)
max
,
String
the raw string to smash
raw
)

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"
public static String

Returns:

the abbreviated text
quote
(String
the text to abbreviate, quote, and generally give you a hint of what the value is.
text
)

Create a hint of what the text is like.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

TextUtilsback to summary
public TextUtils()

Method Detail

hintback to summary
public static String hint(String text)

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:String

the text to abbreviate, quote, and generally give you a hint of what the value is.

Returns:String

the abbreviated text

maxStringLengthback to summary
public static String maxStringLength(int max, String raw)

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:int

the maximum size of the string (minimum size supported is 9)

raw:String

the raw string to smash

Returns:String

the ellipsis'd version of the string.

quoteback to summary
public static String quote(String text)

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:String

the text to abbreviate, quote, and generally give you a hint of what the value is.

Returns:String

the abbreviated text