Package org.jboss.hal.dmr
Class ResourceAddress
- java.lang.Object
-
- org.jboss.hal.dmr.ModelNode
-
- org.jboss.hal.dmr.ResourceAddress
-
-
Constructor Summary
Constructors Constructor Description ResourceAddress()ResourceAddress(ModelNode address)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ResourceAddressadd(String propertyName, String propertyValue)Adds the specified segment to this address.ResourceAddressadd(ResourceAddress address)Adds the specified address to this address.StringfirstValue()static ResourceAddressfrom(String address)Creates a new resource address from the specified string.ResourceAddressgetParent()booleanisEmpty()StringlastName()StringlastValue()ResourceAddressreplaceValue(String name, String newValue)Replaces the value in the specified segmentstatic ResourceAddressroot()intsize()booleanstartsWith(ResourceAddress address)Checks if this resource address starts with the specified address.StringtoString()Get a human-readable string representation of this model node, formatted nicely (possibly on multiple lines).-
Methods inherited from class org.jboss.hal.dmr.ModelNode
add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, addEmptyList, addEmptyObject, addExpression, as, asBigDecimal, asBigInteger, asBoolean, asBoolean, asBytes, asDouble, asDouble, asInt, asInt, asList, asLong, asLong, asObject, asProperty, asPropertyList, asString, asType, clear, clone, equals, equals, fromBase64, get, get, get, getFailureDescription, getType, has, has, hasDefined, hasDefined, hashCode, isDefined, isFailure, keys, protect, remove, require, require, resolve, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, setEmptyList, setEmptyObject, setExpression, setExpression, toBase64String, toJSONString, toJSONString, writeExternal
-
-
-
-
Constructor Detail
-
ResourceAddress
public ResourceAddress()
-
ResourceAddress
public ResourceAddress(ModelNode address)
-
-
Method Detail
-
root
public static ResourceAddress root()
- Returns:
- the empty (root) address
-
from
public static ResourceAddress from(String address)
Creates a new resource address from the specified string.
-
add
public ResourceAddress add(String propertyName, String propertyValue)
Adds the specified segment to this address.
-
add
public ResourceAddress add(ResourceAddress address)
Adds the specified address to this address.- Parameters:
address- The address to add.- Returns:
- this address with the specified address added
-
firstValue
public String firstValue()
- Returns:
- the value of the first segment or null if this address is empty.
-
lastName
public String lastName()
- Returns:
- the name of the last segment or null if this address is empty.
-
lastValue
public String lastValue()
- Returns:
- the value of the last segment or null if this address is empty.
-
getParent
public ResourceAddress getParent()
- Returns:
- the parent address or the root address if this address has no parent.
-
size
public int size()
- Returns:
- the number of segments.
-
isEmpty
public boolean isEmpty()
- Returns:
- whether this address is empty.
-
startsWith
public boolean startsWith(ResourceAddress address)
Checks if this resource address starts with the specified address.- Parameters:
address- The address to check as start- Returns:
- true if this address starts with the passed one, false otherwise
-
replaceValue
public ResourceAddress replaceValue(String name, String newValue)
Replaces the value in the specified segment- Parameters:
name- The name of the segment.newValue- The new value.- Returns:
- this address containing the replaced value
-
-