T - the type of the capable declarationpublic abstract class CapableDeclaration<T extends CapableDeclaration> extends Object implements Capable
| Constructor and Description |
|---|
CapableDeclaration() |
| Modifier and Type | Method and Description |
|---|---|
T |
addCapability(Object capability)
Adds a capability to this declaration
|
Set<Object> |
getCapabilities() |
<C> Set<C> |
getCapabilities(Class<C> capabilityType)
Returns a
Set with the capabilities
which are an instance of the given capability type. |
boolean |
isCapableOf(Class<?> capabilityType)
Tells if this instance is capable of the given capability
|
public Set<Object> getCapabilities()
UnsupportedOperationException - if mutation of this set is attemptedpublic <C> Set<C> getCapabilities(Class<C> capabilityType)
Set with the capabilities
which are an instance of the given capability type.
If no match is found, then an empty Set is
returnedgetCapabilities in interface CapablecapabilityType - the capability to be obtained.Set. Might be empty but will never be nullpublic T addCapability(Object capability)
capability - a not null capability{@link - IllegalArgumentException} if capability is nullpublic boolean isCapableOf(Class<?> capabilityType)
isCapableOf in interface CapablecapabilityType - a capability typeCopyright © 2015 MuleSoft, Inc.. All rights reserved.