public final class YamlUtil extends Object
Modifier and Type | Method and Description |
---|---|
static YamlMapping |
asMapping(YamlNode node)
Takes a generic
YamlNode instance and returns it casted to
YamlMapping if the type of the node is a descendant of
YamlMapping . |
static YamlScalar |
asScalar(YamlNode node)
Takes a generic
YamlNode instance and returns it casted to
YamlScalar if the type of the node is a descendant of
YamlScalar . |
static YamlSequence |
asSequence(YamlNode node)
Takes a generic
YamlNode instance and returns it casted to
YamlSequence if the type of the node is a descendant of
YamlSequence . |
static <T> T |
asType(YamlNode node,
Class<T> type)
Takes a generic
YamlNode instance and returns it casted to
the provided type if the node is an instance of that type. |
static void |
ensureRunningOnJava8OrHigher()
Checks if the runtime environment is Java8 or higher.
|
public static YamlMapping asMapping(YamlNode node)
YamlNode
instance and returns it casted to
YamlMapping
if the type of the node is a descendant of
YamlMapping
.node
- The generic node to castYamlException
- if the provided node is not a mappingpublic static YamlSequence asSequence(YamlNode node)
YamlNode
instance and returns it casted to
YamlSequence
if the type of the node is a descendant of
YamlSequence
.node
- The generic node to castYamlException
- if the provided node is not a sequencepublic static YamlScalar asScalar(YamlNode node)
YamlNode
instance and returns it casted to
YamlScalar
if the type of the node is a descendant of
YamlScalar
.node
- The generic node to castYamlException
- if the provided node is not a scalarpublic static <T> T asType(YamlNode node, Class<T> type)
YamlNode
instance and returns it casted to
the provided type
if the node is an instance of that type.node
- The generic node to castYamlException
- if the provided node is not the expected typepublic static void ensureRunningOnJava8OrHigher()
UnsupportedOperationException
.UnsupportedOperationException
- If the runtime environment
is not Java8 or higherCopyright © 2019 Hazelcast, Inc.. All Rights Reserved.