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.
|
boolean |
equals(Object obj) |
int |
hashCode() |
ContinuousResourceId |
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.
|
String |
toString() |
double |
value()
Returns the value of the resource amount.
|
<T> Optional<T> |
valueAs(Class<T> type)
Returns value interpreted as the specified type.
|
public ContinuousResourceId id()
Resource
public String simpleTypeName()
Resource
simpleTypeName
in interface Resource
public boolean isTypeOf(Class<?> type)
Resource
public double value()
public boolean isSubTypeOf(Class<?> ancestor)
Resource
isSubTypeOf
in interface Resource
ancestor
- type of resource to be checked.public <T> Optional<T> valueAs(Class<T> type)
public DiscreteResource child(Object child)
Resource
UnsupportedOperationException
is thrown. If the given
object is a Class
instance, IllegalArgumentException
is thrown.public ContinuousResource child(Class<?> child, double value)
Resource
UnsupportedOperationException
is thrown.public Optional<DiscreteResource> parent()
Resource