Package org.neo4j.ogm.metadata.reflect
Class GenericUtils
java.lang.Object
org.neo4j.ogm.metadata.reflect.GenericUtils
- Author:
- Frantisek Hartman, Michael J. Simons
-
Method Summary
Modifier and TypeMethodDescriptionstatic Class
findFieldType
(Field field, Class concreteClass) Tries to discover type of given field.static boolean
isGenericField
(Field field) Helper to check whether a given field is a generic field (A field described by a type variable).static boolean
isParameterizedField
(Field field) Helper to check whether a given field is a parameterized field (A field described by a type variable presenting a parameter type).
-
Method Details
-
isGenericField
Helper to check whether a given field is a generic field (A field described by a type variable).- Parameters:
field
- The field to check for a type variable- Returns:
- True, if
field
is a generic field.
-
isParameterizedField
Helper to check whether a given field is a parameterized field (A field described by a type variable presenting a parameter type).- Parameters:
field
- The field to check for a parameterized type- Returns:
- True, if
field
is a parameterized field.
-
findFieldType
Tries to discover type of given field. If the field ha a concrete type then there is nothing to do and it's type is returned. If the field has a generic type then it traverses class hierarchy of the concrete class to discover ParameterizedType with type parameter. If the field is parameterized but no parameter can be discovered, thanObject.class
will be returned.- Parameters:
field
- fieldconcreteClass
- concrete class that either declares the field or is a subclass of such class- Returns:
- type of the field
-