Class MethodAccess.Check

java.lang.Object
org.faktorips.util.MethodAccess.Check
Enclosing class:
MethodAccess

public class MethodAccess.Check extends Object
Offers multiple checks on a MethodAccess in a fluent API.
  • Field Details

  • Method Details

    • exists

      public MethodAccess.Check 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.Check object for further checks.
    • isStatic

      public MethodAccess.Check isStatic()
      If the method exists(), 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.Check object for further checks.
    • isNotStatic

      public MethodAccess.Check isNotStatic()
      If the method exists(), 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.Check object for further checks.
    • returnTypeIsCompatible

      public MethodAccess.Check returnTypeIsCompatible(Class<?>... expectedReturnTypes)
      If the method exists(), 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.class and Boolean.TYPE do not need to be both specified.

      Returns:
      this MethodAccess.Check object for further checks.