public interface TextRepresentation
Modifier and Type | Method and Description |
---|---|
Text |
from(String input)
Return a
Text instance from an appropriately formatted string. |
Text |
fromUnchecked(String input)
Tries to return a
Text instance from the provided input string. |
String |
to(Text text)
Return a string representation of the provided text in a format that will be accepted by this serializer's
from(String) (String)}
method. |
String |
to(Text text,
Locale locale)
Return a string representation of the provided text in a format that will be accepted by this serializer's
from(String) (String)}
method and is appropriate for the given locale. |
String to(Text text)
from(String)
(String)}
method.text
- The text to convert to a string representationString to(Text text, Locale locale)
from(String)
(String)}
method and is appropriate for the given locale.text
- The text to serializelocale
- The locale to serialize this text inText from(String input) throws TextMessageException
Text
instance from an appropriately formatted string.input
- The raw input to parse into a textText
object from the input stringTextMessageException
- if an error occurs while parsing the inputText fromUnchecked(String input)
Text
instance from the provided input string. However, if the input string is not of a valid format, the returned
Text
object will be of the raw input, rather than throwing an exception.input
- The raw input to try to parse into a textText
object from the input string, or the raw input