asFacet(Class). Different implementations, or even different
instances, of a subject may support different facets.
Consult the subject's documentation to determine which facets are available
in each circumstance.
Faceted class, it may be that some instances
support a particular facet while others do not, depending on the state of
the subject or the way it was constructed. In such cases
asFacet should choose whether to return the facet
based on the subject's state.
Such classes should not extend the facet
interface (directly or indirectly), since that allows clients to bypass
asFacet and simply downcast the subject to the facet,
causing problems for instances that can't support the facet.
Facets
| Modifier and Type | Method and Description |
|---|---|
| public < The requested facet type. T> T |
| asFacet | back to summary |
|---|---|
| public <T> T asFacet(Class<T> facetType) Returns a facet of this subject if supported.
| |