Package dev.langchain4j.service
Class TypeUtils
java.lang.Object
dev.langchain4j.service.TypeUtils
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Class
<?> getRawClass
(Type type) static Class
<?> resolveFirstGenericParameterClass
(Type returnType) static boolean
typeHasRawClass
(Type type, Class<?> rawClass) static void
validateReturnTypesAreProperlyParametrized
(String methodName, Type type) Ensures that no wildcard and/or parametrized types are being used as service method return type.
-
Constructor Details
-
TypeUtils
public TypeUtils()
-
-
Method Details
-
getRawClass
-
typeHasRawClass
-
resolveFirstGenericParameterClass
-
validateReturnTypesAreProperlyParametrized
Ensures that no wildcard and/or parametrized types are being used as service method return type.
For example - such (service) method return types will pass:
- String
- MyCustomPojo
- List<MyCustomPojo>
- Set<MyCustomPojo>
- Result<String>
- Result<MyCustomPojo>
- Result<List<MyCustomPojo>>
- List<?>
- Result<?>
- Result<List<?>>
- List<T>
- Result<T>
- Result<List<T>>
- Parameters:
methodName
- the method nametype
- the return type
-