@JsType public class ModelNodeHelper extends Object
| Modifier and Type | Method and Description |
|---|---|
static <E extends Enum<E>> |
asAttributeValue(E enumValue)
The reverse operation to
asEnumValue(ModelNode, String, Function, Enum). |
static <E extends Enum<E>> |
asEnumValue(ModelNode modelNode,
Function<String,E> valueOf,
E defaultValue) |
static <E extends Enum<E>> |
asEnumValue(ModelNode modelNode,
String attribute,
Function<String,E> valueOf,
E defaultValue)
Looks for the specified attribute and tries to convert it to an enum constant using
LOWER_HYPHEN.to(UPPER_UNDERSCORE, modelNode.get(attribute).asString()). |
static List<NamedNode> |
asNamedNodes(List<Property> properties)
Turns a list of properties into a list of named model nodes which contains a
ModelDescriptionConstants.NAME key with the properties name. |
static String |
decodeValue(String value) |
static String |
encodeValue(String value) |
static boolean |
failSafeBoolean(ModelNode modelNode,
String path)
Tries to get a deeply nested boolean value from the specified model node.
|
static Date |
failSafeDate(ModelNode modelNode,
String path) |
static ModelNode |
failSafeGet(ModelNode modelNode,
String path)
Tries to get a deeply nested model node from the specified model node.
|
static List<ModelNode> |
failSafeList(ModelNode modelNode,
String path) |
static List<Property> |
failSafePropertyList(ModelNode modelNode,
String path) |
static <T> T |
getOrDefault(ModelNode modelNode,
String attribute,
Supplier<T> supplier,
T defaultValue) |
static NamedNode[] |
jsAsNamedNodes(Property[] properties)
Turns an properties array into an array of names nodes.
|
static ModelNode[] |
jsFailSafeList(ModelNode modelNode,
String path)
Tries to get a deeply nested node array from the specified model node.
|
static Property[] |
jsFailSafePropertyList(ModelNode modelNode,
String path)
Tries to get a deeply nested property array from the specified model node.
|
static void |
move(ModelNode modelNode,
String source,
String destination)
Moves an attribute to another destination.
|
static void |
storeIndex(List<ModelNode> modelNodes) |
public static ModelNode failSafeGet(ModelNode modelNode, String path)
modelNode - The model node to read frompath - A path separated with "/"public static boolean failSafeBoolean(ModelNode modelNode, String path)
modelNode - The model node to read frompath - A path separated with "/"@JsIgnore public static List<Property> failSafePropertyList(ModelNode modelNode, String path)
@JsIgnore public static <T> T getOrDefault(ModelNode modelNode, String attribute, Supplier<T> supplier, T defaultValue)
@JsIgnore public static List<NamedNode> asNamedNodes(List<Property> properties)
ModelDescriptionConstants.NAME key with the properties name.@JsIgnore public static <E extends Enum<E>> E asEnumValue(ModelNode modelNode, String attribute, Function<String,E> valueOf, E defaultValue)
LOWER_HYPHEN.to(UPPER_UNDERSCORE, modelNode.get(attribute).asString()).@JsIgnore public static <E extends Enum<E>> E asEnumValue(ModelNode modelNode, Function<String,E> valueOf, E defaultValue)
@JsIgnore public static <E extends Enum<E>> String asAttributeValue(E enumValue)
asEnumValue(ModelNode, String, Function, Enum).public static void move(ModelNode modelNode, String source, String destination)
@JsMethod(name="failSafeList") public static ModelNode[] jsFailSafeList(ModelNode modelNode, String path)
modelNode - The model node to read frompath - A path separated with "/"@JsMethod(name="failSafePropertyList") public static Property[] jsFailSafePropertyList(ModelNode modelNode, String path)
modelNode - The model node to read frompath - A path separated with "/"Copyright © 2018 JBoss, a division of Red Hat. All rights reserved.