public class CapabilityUtils extends Object
Modifier and Type | Method and Description |
---|---|
static <T> Set<T> |
getCapabilities(Set<?> capabilities,
Class<T> capabilityType)
Returns the items in
capabilities which
are instances of capabilityType |
static <T> T |
getSingleCapability(org.mule.extension.introspection.Capable capable,
Class<T> capabilityType)
Expects
capable to have at most one capability of type capabilityType
and returns such capability. |
static <T> T |
getSingleCapability(Set<?> capabilities,
Class<T> capabilityType)
Expects the
capabilities Set to have at most one capability of type capabilityType
and returns such capability. |
static boolean |
isCapableOf(Set<?> capabilities,
Class<?> capabilityType)
Returns
true if {code capabilities} contains at least
one item which is an instance of capabilityType |
public static <T> Set<T> getCapabilities(Set<?> capabilities, Class<T> capabilityType)
capabilities
which
are instances of capabilityType
public static boolean isCapableOf(Set<?> capabilities, Class<?> capabilityType)
true
if {code capabilities} contains at least
one item which is an instance of capabilityType
capabilities
- a Set
of capabilitiescapabilityType
- the type of the capabilities you seektrue
if at least one of the capabilities is of type capabilityType
. false
otherwisepublic static <T> T getSingleCapability(org.mule.extension.introspection.Capable capable, Class<T> capabilityType)
capable
to have at most one capability of type capabilityType
and returns such capability.
If capable
doesn't have a matching capability, then it returns null
.
If capable
has more than one instance of that capability, then it throws
IllegalArgumentException
T
- the generic type of the capability you're looking forcapable
- a Capable
capabilityType
- a capability t ypenull
IllegalArgumentException
- if more than one capability of type capabilityType
is foundCopyright © 2003–2016 MuleSoft, Inc.. All rights reserved.