public final class BooleanNode extends Node
Node.NonNumericFloat
Constructor and Description |
---|
BooleanNode(boolean value,
SourceLocation sourceLocation) |
Modifier and Type | Method and Description |
---|---|
<R> R |
accept(NodeVisitor<R> visitor)
Accepts a visitor with the node.
|
java.util.Optional<BooleanNode> |
asBooleanNode()
Gets the node as an BooleanNode if it is an boolean.
|
boolean |
equals(java.lang.Object other) |
BooleanNode |
expectBooleanNode(java.lang.String errorMessage)
Casts the current node to a
BooleanNode , throwing
ExpectationNotMetException when the node is the wrong type. |
BooleanNode |
expectBooleanNode(java.util.function.Supplier<java.lang.String> errorMessage)
Casts the current node to a
BooleanNode , throwing
ExpectationNotMetException when the node is the wrong type. |
NodeType |
getType()
Gets the type of the node.
|
boolean |
getValue()
Gets the true or false value of the boolean node.
|
int |
hashCode() |
java.lang.String |
toString() |
arrayNode, arrayNode, asArrayNode, asNullNode, asNumberNode, asObjectNode, assertEquals, asStringNode, diff, expectArrayNode, expectArrayNode, expectArrayNode, expectBooleanNode, expectNullNode, expectNullNode, expectNullNode, expectNumberNode, expectNumberNode, expectNumberNode, expectObjectNode, expectObjectNode, expectObjectNode, expectStringNode, expectStringNode, expectStringNode, 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
public BooleanNode(boolean value, SourceLocation sourceLocation)
public boolean getValue()
public <R> R accept(NodeVisitor<R> visitor)
Node
public BooleanNode expectBooleanNode(java.lang.String errorMessage)
Node
BooleanNode
, throwing
ExpectationNotMetException
when the node is the wrong type.expectBooleanNode
in class Node
errorMessage
- Error message to use if the node is of the wrong type.public BooleanNode expectBooleanNode(java.util.function.Supplier<java.lang.String> errorMessage)
Node
BooleanNode
, throwing
ExpectationNotMetException
when the node is the wrong type.expectBooleanNode
in class Node
errorMessage
- Error message supplier.public java.util.Optional<BooleanNode> asBooleanNode()
Node
asBooleanNode
in class Node
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object