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.ValueType<Object>
- Direct Known Subclasses:
ListNode
,MapNode
,ObjectNode
public class NodeKey<V> extends NodeValue<V>
Class that represents a node with parent node and key parameter along with value.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description @Nullable String
getKey()
Get the node key associated with this node.@Nullable MapNode
getParent()
Get the parent node that this node is child of.static @NotNull SettingsNode
of(@Nullable MapNode parent, @Nullable String key, @Nullable Object object)
Create a node key with the given parameters.@NotNull SettingsNode
setKey(@Nullable String key)
Replace the key associated with this node.@NotNull SettingsNode
setParent(MapNode parent)
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, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.saicone.settings.SettingsNode
addSideComment, addTopComment, asListNode, asLiteralObject, asMapNode, asObjectNode, copy, copy, copy, delete, delete, edit, edit, getRoot, isList, isMap, isObject, isReal, isRoot, merge, mergeComment, move, parse, parse, replaceArgs, replaceArgs
-
Methods inherited from interface com.saicone.types.ValueType
as, as, asArray, asArray, asArray, asBoolean, asBoolean, asByte, asByte, asChar, asChar, asDouble, asDouble, asFloat, asFloat, asInt, asInt, asList, asLong, asLong, asMap, asNumber, asNumber, asSet, asShort, asShort, asString, asString, asUniqueId, asUniqueId
-
-
-
-
Method Detail
-
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
@Nullable public @Nullable MapNode getParent()
Description copied from interface:SettingsNode
Get the parent node that this node is child of.- Returns:
- a map node if exists, null otherwise.
-
getKey
@Nullable public @Nullable String getKey()
Description copied from interface:SettingsNode
Get the node key associated with this node.- Returns:
- a node key if is set, null otherwise.
-
setParent
@NotNull public @NotNull SettingsNode setParent(MapNode parent)
Description copied from interface:SettingsNode
Replace the parent node that this node come from.- Parameters:
parent
- a map node.- Returns:
- the effective node in this operation, normally this node.
-
setKey
@NotNull public @NotNull SettingsNode setKey(@Nullable @Nullable String key)
Description copied from interface:SettingsNode
Replace the key associated with this node.- Parameters:
key
- a node key.- Returns:
- the effective node in this operation, normally this node.
-
-