Package org.dellroad.stuff.text
Class MessageFmt.TextSegment
java.lang.Object
org.dellroad.stuff.text.MessageFmt.Segment
org.dellroad.stuff.text.MessageFmt.TextSegment
- Enclosing class:
- MessageFmt
Represents a stretch of plain text in a
MessageFormat
pattern string.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
@NotNull String
Get the associated plain text.int
hashCode()
void
Encode this segment as aMessageFormat
pattern fragment.toString()
void
visit
(MessageFmt.SegmentSwitch target) Visit the method of the given switch corresponding to this instance's concrete type.
-
Constructor Details
-
TextSegment
public TextSegment() -
TextSegment
-
-
Method Details
-
getString
Get the associated plain text.- Returns:
- segment plain text
-
setString
-
toPattern
Description copied from class:MessageFmt.Segment
Encode this segment as aMessageFormat
pattern fragment.The concatenation of the encoding of the
MessageFmt.Segment
s in aMessageFmt
produces the correspondingMessageFormat
pattern string.This method is responsible for escaping single quotes and opening curly braces, if necessary.
- Specified by:
toPattern
in classMessageFmt.Segment
- Returns:
MessageFormat
pattern string text
-
visit
Description copied from class:MessageFmt.Segment
Visit the method of the given switch corresponding to this instance's concrete type.- Specified by:
visit
in classMessageFmt.Segment
- Parameters:
target
- visitor pattern target
-
equals
- Overrides:
equals
in classMessageFmt.Segment
-
hashCode
public int hashCode()- Overrides:
hashCode
in classMessageFmt.Segment
-
toString
-