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