public class YamlScalarImpl extends AbstractYamlNode implements MutableYamlScalar
UNNAMED_NODE
Constructor and Description |
---|
YamlScalarImpl(YamlNode parent,
String nodeName,
Object value) |
Modifier and Type | Method and Description |
---|---|
<T> boolean |
isA(Class<T> type)
Checks if the value of this node is the given type
|
<T> T |
nodeValue()
Gets the value of the node
Please note that if the scalar's type is not the expected type T,
a
ClassCastException is thrown at the call site. |
<T> T |
nodeValue(Class<T> type)
Gets the value of the node with validating its type against the
provided type
|
void |
setValue(Object newValue)
Sets the value of the scalar node
|
String |
toString() |
nodeName, parent, path, setNodeName
public <T> boolean isA(Class<T> type)
YamlScalar
isA
in interface YamlScalar
T
- the type to checktype
- the Class
instance of the type to checkpublic <T> T nodeValue()
YamlScalar
ClassCastException
is thrown at the call site.nodeValue
in interface YamlScalar
T
- the expected type of the nodepublic <T> T nodeValue(Class<T> type)
YamlScalar
nodeValue
in interface YamlScalar
T
- the expected type of the nodepublic void setValue(Object newValue)
MutableYamlScalar
setValue
in interface MutableYamlScalar
newValue
- The new value of the scalar nodeCopyright © 2022 Hazelcast, Inc.. All Rights Reserved.