Class NullNode
- java.lang.Object
-
- software.amazon.smithy.model.node.Node
-
- software.amazon.smithy.model.node.NullNode
-
- All Implemented Interfaces:
FromSourceLocation
,ToNode
public final class NullNode extends Node
Represents a null node.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class software.amazon.smithy.model.node.Node
Node.NonNumericFloat
-
-
Constructor Summary
Constructors Constructor Description NullNode(SourceLocation sourceLocation)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <R> R
accept(NodeVisitor<R> visitor)
Accepts a visitor with the node.java.util.Optional<NullNode>
asNullNode()
Gets the node as an NullNode if it is a null.boolean
equals(java.lang.Object other)
NullNode
expectNullNode(java.lang.String errorMessage)
Casts the current node to aNullNode
, throwingExpectationNotMetException
when the node is the wrong type.NullNode
expectNullNode(java.util.function.Supplier<java.lang.String> errorMessage)
Casts the current node to aNullNode
, throwingExpectationNotMetException
when the node is the wrong type.NodeType
getType()
Gets the type of the node.int
hashCode()
java.lang.String
toString()
-
Methods inherited from class software.amazon.smithy.model.node.Node
arrayNode, arrayNode, asArrayNode, asBooleanNode, asNumberNode, asObjectNode, assertEquals, asStringNode, diff, expectArrayNode, expectArrayNode, expectArrayNode, expectBooleanNode, expectBooleanNode, expectBooleanNode, expectNullNode, expectNumberNode, expectNumberNode, expectNumberNode, expectObjectNode, expectObjectNode, expectObjectNode, expectStringNode, expectStringNode, expectStringNode, from, from, from, from, fromNodes, fromNodes, fromStrings, fromStrings, getSourceLocation, isArrayNode, isBooleanNode, isNullNode, isNumberNode, isObjectNode, isStringNode, loadArrayOfString, nullNode, objectNode, objectNode, objectNodeBuilder, parse, parse, parse, parse, parseJsonWithComments, parseJsonWithComments, prettyPrintJson, prettyPrintJson, printJson, toNode, withDeepSortedKeys, withDeepSortedKeys
-
-
-
-
Constructor Detail
-
NullNode
public NullNode(SourceLocation sourceLocation)
-
-
Method Detail
-
accept
public <R> R accept(NodeVisitor<R> visitor)
Description copied from class:Node
Accepts a visitor with the node.
-
expectNullNode
public NullNode expectNullNode(java.lang.String errorMessage)
Description copied from class:Node
Casts the current node to aNullNode
, throwingExpectationNotMetException
when the node is the wrong type.- Overrides:
expectNullNode
in classNode
- Parameters:
errorMessage
- Error message to use if the node is of the wrong type.- Returns:
- Returns a null node.
-
expectNullNode
public NullNode expectNullNode(java.util.function.Supplier<java.lang.String> errorMessage)
Description copied from class:Node
Casts the current node to aNullNode
, throwingExpectationNotMetException
when the node is the wrong type.- Overrides:
expectNullNode
in classNode
- Parameters:
errorMessage
- Error message supplier.- Returns:
- Returns a null node.
-
asNullNode
public java.util.Optional<NullNode> asNullNode()
Description copied from class:Node
Gets the node as an NullNode if it is a null.- Overrides:
asNullNode
in classNode
- Returns:
- Returns the optional NullNode.
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-