Package org.gcube.common.events.impl
Class ReflectionUtils
java.lang.Object
org.gcube.common.events.impl.ReflectionUtils
Library-wide reflection utilities.
- Author:
- Fabio Simeoni, Luca Frosini (ISTI-CNR)
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanChecks if the given type contains type variables.static TypeReturns the element type of a Collection type.static booleanChecks if the given type is a Collection type.static TypeReturns the actual type of an event, handling Event wrappers appropriately.static ObjectReturns the actual value of an event, unwrapping Event wrappers if necessary.
-
Method Details
-
typeOf
Returns the actual type of an event, handling Event wrappers appropriately.- Parameters:
event- the event object- Returns:
- the type of the event
-
valueOf
Returns the actual value of an event, unwrapping Event wrappers if necessary.- Parameters:
event- the event object- Returns:
- the unwrapped event value
-
isCollectionType
Checks if the given type is a Collection type.- Parameters:
t- the type to check- Returns:
- true if the type is a Collection type
-
elementTypeOf
Returns the element type of a Collection type.- Parameters:
t- the collection type- Returns:
- the element type
- Throws:
RuntimeException- if invoked with non-collection type or type variable
-
containsVariable
Checks if the given type contains type variables.- Parameters:
t- the type to check- Returns:
- true if the type contains type variables
-