Package com.saicone.settings.node
Class NodeKey<V>
java.lang.Object
com.saicone.settings.node.NodeValue<V>
com.saicone.settings.node.NodeKey<V>
- Type Parameters:
V- the value type of the node.
- All Implemented Interfaces:
SettingsNode,com.saicone.types.AnyObject<Object>
- Direct Known Subclasses:
ListNode,MapNode,ObjectNode
Class that represents a node with parent node and key parameter along with value.
-
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 TypeMethodDescriptiongetKey()Get the node key associated with this node.Get the parent node that this node is child of.static @NotNull SettingsNodeCreate a node key with the given parameters.Replace the key associated with this node.Replace the parent node that this node come from.Methods inherited from class com.saicone.settings.node.NodeValue
as, as, asCollection, asEnum, asEnum, asOptional, equals, getFaceValue, getSideComment, getSourceValue, getTopComment, getValue, hashCode, hasSideComment, hasTopComment, of, setSideComment, setSourceValue, setTopComment, setValue, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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 com.saicone.settings.SettingsNode
addSideComment, addTopComment, asListNode, asLiteralObject, asMapNode, asObjectNode, copy, copy, copy, delete, delete, edit, edit, getRoot, isEmpty, isList, isMap, isObject, isReal, isRoot, merge, mergeComment, move, moveRoot, parse, parse, replaceArgs, replaceArgs
-
Constructor Details
-
NodeKey
Constructs a node key with the given parameters.- Parameters:
parent- the parent node.value- the object to wrap as node key.
-
NodeKey
public NodeKey(@Nullable @Nullable MapNode parent, @Nullable @Nullable String key, @Nullable V value) Constructs a node key with the given parameters.- Parameters:
parent- the parent node.key- the node key.value- the object to wrap as node key.
-
-
Method Details
-
of
@NotNull public static @NotNull SettingsNode of(@Nullable @Nullable MapNode parent, @Nullable @Nullable String key, @Nullable @Nullable Object object) Create a node key with the given parameters.- Parameters:
parent- the parent node.key- the node key.object- the object to wrap as node key.- Returns:
- a settings object that represents the node key.
-
getParent
Description copied from interface:SettingsNodeGet the parent node that this node is child of.- Returns:
- a map node if exists, null otherwise.
-
getKey
Description copied from interface:SettingsNodeGet the node key associated with this node.- Returns:
- a node key if is set, null otherwise.
-
setParent
Description copied from interface:SettingsNodeReplace the parent node that this node come from.- Parameters:
parent- a map node.- Returns:
- the effective node in this operation, normally this node.
-
setKey
Description copied from interface:SettingsNodeReplace the key associated with this node.- Parameters:
key- a node key.- Returns:
- the effective node in this operation, normally this node.
-