public interface Faceted
For example, an instance of an Entity
may have a facet
for accessing its inventory (if it contains an inventory) or a facet
for accessing its health (if it has health).
Facets are referred to by their interface or abstract class and
it is dependent on the implementation of the object specifying this
interface to return the most applicable implementation. However, in
many cases, such an implementation may not apply or it has not been
implemented so a request for a facet may return null
.
Modifier and Type | Method and Description |
---|---|
<T> T |
getFacet(java.lang.Class<? extends T> cls)
Get the facet corresponding to the given class or interface.
|