@Beta
public interface Resource
Modifier and Type | Field and Description |
---|---|
static DiscreteResource |
ROOT |
Modifier and Type | Method and Description |
---|---|
ContinuousResource |
child(Class<?> child,
double value)
Returns a child resource of this instance with specifying a child object and
value.
|
DiscreteResource |
child(Object child)
Returns a child resource of this instance with specifying the child object.
|
ResourceId |
id()
Returns the ID of this resource.
|
boolean |
isSubTypeOf(Class<?> ancestor)
Checks if the type of this instance is the sub-type of the specified type.
|
boolean |
isTypeOf(Class<?> type)
Checks if the type of this instance is the specified type.
|
Optional<DiscreteResource> |
parent()
Returns the parent resource of this instance.
|
String |
simpleTypeName()
Returns the simple type name of this resource.
|
<T> Optional<T> |
valueAs(Class<T> type)
Returns value interpreted as the specified type.
|
static final DiscreteResource ROOT
ResourceId id()
String simpleTypeName()
boolean isTypeOf(Class<?> type)
type
- type of resource to be checkedboolean isSubTypeOf(Class<?> ancestor)
ancestor
- type of resource to be checked.<T> Optional<T> valueAs(Class<T> type)
T
- type of the return valuetype
- class instance specifying the type of return valueOptional<DiscreteResource> parent()
DiscreteResource child(Object child)
UnsupportedOperationException
is thrown. If the given
object is a Class
instance, IllegalArgumentException
is thrown.child
- child objectIllegalArgumentException
- if the given object is a Class
instance.ContinuousResource child(Class<?> child, double value)
UnsupportedOperationException
is thrown.child
- child objectvalue
- value