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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean@NotNull StringGet the associated plain text.inthashCode()voidEncode this segment as aMessageFormatpattern fragment.toString()voidvisit(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.SegmentEncode this segment as aMessageFormatpattern fragment.The concatenation of the encoding of the
MessageFmt.Segments in aMessageFmtproduces the correspondingMessageFormatpattern string.This method is responsible for escaping single quotes and opening curly braces, if necessary.
- Specified by:
toPatternin classMessageFmt.Segment- Returns:
MessageFormatpattern string text
-
visit
Description copied from class:MessageFmt.SegmentVisit the method of the given switch corresponding to this instance's concrete type.- Specified by:
visitin classMessageFmt.Segment- Parameters:
target- visitor pattern target
-
equals
- Overrides:
equalsin classMessageFmt.Segment
-
hashCode
public int hashCode()- Overrides:
hashCodein classMessageFmt.Segment
-
toString
-