Class MultilineString
java.lang.Object
com.mrivanplays.annotationconfig.core.resolver.MultilineString
Represents a
String
value, which is annotated with Multiline
, marking that it
should be dumped as a multiline string, if the configuration type used supports them, otherwise
should be dumped as a regular String
.
If a Field
is annotated with Multiline
, then this object will be put into the
map which a ValueWriter
would receive. Example of handling this:
Object value = // ...
if (value instanceof MultilineString) {
MultilineString multiline = (MultilineString) value;
String toWrite = multiline.getString();
char c = multiline.getMarkerChar();
// do writer logic
}
- Since:
- 2.1.0
- Author:
- MrIvanPlays
- See Also:
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
MultilineString
-
-
Method Details
-
getString
Get theString
to write.- Returns:
- to write
-
getMarkerChar
Returns theCharacter
marker.A marker character could be the "pipe" or '|', could be the double quote or whatever
char
the configuration type this is going to be dumped to is supported.In YAML's scenario, the '|' or the '>' characters are used before the multiline string is specified, which makes them "marker" characters e.g.
foo: | Lorem ipsum\n dolor sit amet
Orfoo: > Lorem ipsum\n dolor sit amet
As shown by the examples above, this character in YAML's scenario could return '|' or '>' or the double quotes.
- Returns:
- marker character
-
equals
-
hashCode
-
toString
-