Class NodeValue<V>
java.lang.Object
com.saicone.settings.node.NodeValue<V>
- Type Parameters:
V- the value type of the node.
- All Implemented Interfaces:
SettingsNode, com.saicone.types.AnyObject<Object>
- Direct Known Subclasses:
NodeKey
Abstract class that represents a node multi-layer value along with comments.
Any type transformation will be cached.
Any type transformation will be cached.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.saicone.types.AnyObject
com.saicone.types.AnyObject.Registry -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<E> E<E> E<E, C extends Collection<E>>
CasCollection(@NotNull com.saicone.types.TypeParser<E> parser, C collection) <E extends Enum<E>>
E<E extends Enum<E>>
EasOptional(@NotNull com.saicone.types.TypeParser<E> parser) booleanGet the facing value inside the node.Get side comment from the node.Get the value that will be used to save this node.Get top comment from the node.getValue()inthashCode()booleanCheck if the current node has any side comment.booleanCheck if the current node has any top comment.static @NotNull SettingsNodeCreate a node value with the given object.setSideComment(@Nullable List<String> sideComment) Replace the node side comment.setSourceValue(@Nullable Object value) Replace the actual source value.setTopComment(@Nullable List<String> topComment) Replace the node top comment.Set the value that will be return onAnyObject.getValue()and change this node instance depending on actual value.
If source value is not set will be replaced.toString()Methods inherited from interface com.saicone.types.AnyObject
as, as, asArray, asArray, asArray, asArray, asBigDecimal, asBigDecimal, asBigInteger, asBigInteger, asBoolean, asBoolean, asByte, asByte, asChar, asChar, asDouble, asDouble, asFloat, asFloat, asInt, asInt, asList, asLong, asLong, asMap, asMap, asNumber, asNumber, asSet, asShort, asShort, asString, asString, asUniqueId, asUniqueIdMethods inherited from interface SettingsNode
addSideComment, addTopComment, asListNode, asLiteralObject, asMapNode, asObjectNode, copy, copy, copy, delete, delete, edit, edit, getKey, getParent, getRoot, isEmpty, isList, isMap, isObject, isReal, isRoot, merge, mergeComment, move, moveRoot, parse, parse, replaceArgs, replaceArgs, setKey, setParent
-
Constructor Details
-
NodeValue
-
-
Method Details
-
of
-
hasTopComment
public boolean hasTopComment()Description copied from interface:SettingsNodeCheck if the current node has any top comment.- Specified by:
hasTopCommentin interfaceSettingsNode- Returns:
- true if the node contains a top comment.
-
hasSideComment
public boolean hasSideComment()Description copied from interface:SettingsNodeCheck if the current node has any side comment.- Specified by:
hasSideCommentin interfaceSettingsNode- Returns:
- true if the node contains a side comment.
-
getValue
-
getFaceValue
-
getSourceValue
Description copied from interface:SettingsNodeGet the value that will be used to save this node.- Specified by:
getSourceValuein interfaceSettingsNode- Returns:
- a saved source value, null otherwise.
-
getTopComment
Description copied from interface:SettingsNodeGet top comment from the node.- Specified by:
getTopCommentin interfaceSettingsNode- Returns:
- a comment if is set, null otherwise.
-
getSideComment
Description copied from interface:SettingsNodeGet side comment from the node.- Specified by:
getSideCommentin interfaceSettingsNode- Returns:
- a comment if is set, null otherwise.
-
setValue
Description copied from interface:SettingsNodeSet the value that will be return onAnyObject.getValue()and change this node instance depending on actual value.
If source value is not set will be replaced.- Specified by:
setValuein interfaceSettingsNode- Parameters:
value- the value to set.- Returns:
- the effective node in this operation, normally this node.
-
setSourceValue
Description copied from interface:SettingsNodeReplace the actual source value.- Specified by:
setSourceValuein interfaceSettingsNode- Parameters:
value- the source value to set.- Returns:
- the effective node in this operation, normally this node.
-
setTopComment
Description copied from interface:SettingsNodeReplace the node top comment.- Specified by:
setTopCommentin interfaceSettingsNode- Parameters:
topComment- the comment to set.- Returns:
- the effective node in this operation, normally this node.
-
setSideComment
Description copied from interface:SettingsNodeReplace the node side comment.- Specified by:
setSideCommentin interfaceSettingsNode- Parameters:
sideComment- the comment to set.- Returns:
- the effective node in this operation, normally this node.
-
as
-
as
-
asOptional
-
asCollection
-
asEnum
-
asEnum
-
toString
-
equals
-
hashCode
-