public interface IniElement extends CharSequence, Serializable
sections, properties, comments.
they all can be like String .| Modifier and Type | Method and Description |
|---|---|
void |
clearComment()
clear comment (if exists).
|
IniComment |
getComment()
there may be comments at the end of each element.
|
default Optional<IniComment> |
getCommentOptional()
there may be comments at the end of each element.
|
String |
getOriginalValue()
get the original string.
|
default boolean |
isComment()
Am I comment?
|
default boolean |
isProperty()
Am I property?
|
default boolean |
isSection()
Am I section?
|
int |
line()
the line number where you are.
|
default String |
setValue(Function<String,String> valueEditor)
Edit the value of this element on the basis of original value .
|
String |
setValue(String newValue)
change this element's value.
|
String |
toCompleteString()
Get complete information.
|
String |
toNoCommentString()
like
toString(), without comment value(if exists). |
String |
toString()
need to override toString method, to show complete information.
|
String |
value()
this element's value.
|
charAt, chars, codePoints, length, subSequenceString value()
toString value like comment,
a property's value like property or a title value like section .String setValue(String newValue)
newValue - a new valuevalue()IniComment getComment()
getCommentOptional().getCommentOptional()void clearComment()
String toNoCommentString()
toString(), without comment value(if exists).String toCompleteString()
section.toString() + all properties.toString() + comment.toString()
In general, it is about the same as toString().String toString()
toString in interface CharSequencetoString in class ObjectString getOriginalValue()
int line()
default Optional<IniComment> getCommentOptional()
getComment()default String setValue(Function<String,String> valueEditor)
valueEditor - function to edit old value, oldValue -> {
// edit ...
return newValue;
}default boolean isComment()
default boolean isProperty()
default boolean isSection()
Copyright © 2022. All rights reserved.