public class NodeCompat extends Object
Constructor and Description |
---|
NodeCompat() |
Modifier and Type | Method and Description |
---|---|
static String[] |
asArray(List<String> list)
Turns a list into an array.
|
static List<String> |
asList(String... items)
Creates a list from a bunch of argument items.
|
static List<String> |
copyList(List<String> list)
Makes a copy of a list.
|
static boolean |
equals(Object value1,
Object value2)
Tests two objects for equality.
|
static Object |
getProperty(Object node,
String propertyName)
Returns the value for a given node property.
|
static int |
indexOf(Node child,
Node parent,
String propertyName)
Figures out the index of the given child by interrogating the parent node's list of
children at the given property name.
|
static boolean |
isList(Object object)
Returns true if the given object is a list.
|
static boolean |
isNode(Object object)
Return true if the given object is a Node.
|
static boolean |
isNullOrUndefined(Object value)
Returns true if the given value is null or undefined.
|
static String |
join(String delim,
List<String> values)
Joins a list of strings into a single string with a given delimiter.
|
static String |
joinArray(String delim,
String[] values)
Joins a list of strings into a single string with a given delimiter.
|
static void |
setProperty(Object node,
String propertyName,
Object newValue)
Sets the value for a given node property.
|
public static Object getProperty(Object node, String propertyName)
node
- propertyName
- public static void setProperty(Object node, String propertyName, Object newValue)
node
- propertyName
- newValue
- public static int indexOf(Node child, Node parent, String propertyName)
child
- parent
- propertyName
- public static boolean equals(Object value1, Object value2)
value1
- value2
- public static String join(String delim, List<String> values)
delim
- values
- public static String joinArray(String delim, String[] values)
delim
- values
- public static boolean isNode(Object object)
object
- public static boolean isList(Object object)
object
- public static String[] asArray(List<String> list)
list
- public static List<String> asList(String... items)
items
- public static List<String> copyList(List<String> list)
list
- public static boolean isNullOrUndefined(Object value)
value
- Copyright © 2019 Red Hat. All rights reserved.