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 capabilityTypepublic static boolean isCapableOf(Set<?> capabilities, Class<?> capabilityType)
true if {code capabilities} contains at least
one item which is an instance of capabilityTypecapabilities - 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
IllegalArgumentExceptionT - the generic type of the capability you're looking forcapable - a CapablecapabilityType - a capability t ypenullIllegalArgumentException - if more than one capability of type capabilityType is foundCopyright © 2003–2023 MuleSoft, Inc.. All rights reserved.