Class NullNode
java.lang.Object
com.github.siroshun09.configapi.core.node.NullNode
A
Node
implementation that represents null
.-
Field Summary
-
Method Summary
Modifier and TypeMethodDescription@NotNull VisitResult
accept
(@NotNull NodeVisitor visitor) Accepts aNodeVisitor
for thisNode
.Gets an object asOptional
.boolean
hasValue()
Checks if thisNode
holds an object.@Nullable Object
value()
Gets an object which thisNode
holds
-
Field Details
-
NULL
An instance ofNullNode
.
-
-
Method Details
-
value
Description copied from interface:Node
Gets an object which thisNode
holds -
hasValue
public boolean hasValue()Description copied from interface:Node
Checks if thisNode
holds an object.The default implementation of this method checks if the returning value from
Node.value()
is notnull
. -
asOptional
Description copied from interface:Node
Gets an object asOptional
.The default implementation of this method returns
Optional.ofNullable(Object)
which is wrappingNode.value()
.- Specified by:
asOptional
in interfaceNode<Object>
- Returns:
- the
Optional
-
accept
Description copied from interface:Node
Accepts aNodeVisitor
for thisNode
.- Specified by:
accept
in interfaceNode<Object>
- Parameters:
visitor
- aNodeVisitor
to accept- Returns:
- a
VisitResult
-