Package org.faktorips.util
Class MethodAccess.Check
java.lang.Object
org.faktorips.util.MethodAccess.Check
- Enclosing class:
MethodAccess
Offers multiple checks on a
MethodAccess in a fluent API.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionexists()Checks whether the method exists.If the methodexists(), checks whether the method is not static.isStatic()If the methodexists(), checks whether the method is static.returnTypeIsCompatible(Class<?>... expectedReturnTypes) If the methodexists(), checks whether the method return type is compatible to any one of the given return types.
-
Field Details
-
MSG_CODE_SUFFIX_DOES_NOT_EXIST
- See Also:
-
MSG_CODE_SUFFIX_NOT_STATIC
- See Also:
-
MSG_CODE_SUFFIX_STATIC
- See Also:
-
MSG_CODE_SUFFIX_INCOMPATIBLE_RETURN_TYPE
- See Also:
-
-
Method Details
-
exists
Checks whether the method exists. If the method does not exist or cannot be accessed from this class, an error message with a message code ending in "_NOT_FOUND" will be added to the message list.- Returns:
- this
MethodAccess.Checkobject for further checks.
-
isStatic
If the methodexists(), checks whether the method is static. If the method is not static, an error message with a message code ending in "_NOT_STATIC" will be added to the message list.- Returns:
- this
MethodAccess.Checkobject for further checks.
-
isNotStatic
If the methodexists(), checks whether the method is not static. If the method is static, an error message with a message code ending in "_STATIC" will be added to the message list.- Returns:
- this
MethodAccess.Checkobject for further checks.
-
returnTypeIsCompatible
If the methodexists(), checks whether the method return type is compatible to any one of the given return types. If the method returns something different, an error message with a message code ending in "_INCOMPATIBLE_RETURN_TYPE" will be added to the message list.Compatible primitive datatypes and their wrappers will be mapped automatically, so for example
Boolean.classandBoolean.TYPEdo not need to be both specified.- Returns:
- this
MethodAccess.Checkobject for further checks.
-