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