getParameterType

abstract fun getParameterType(): Class<T>(source)

Returns the expected type of the parameter.

Contract

The parameter type must conform to the following rules:

  • It must be an interface.
  • It must contain only getter-like and setter-like methods.
  • There must be one getter corresponding to exactly one setter, with matching value types.

For each getter-like method:

  • The name must start with "get" or "is", followed by an uppercase letter.
  • It must have no parameters.
  • The return type must not be void.

For each setter-like method:

  • The name must start with "set", followed by an uppercase letter.
  • It must have exactly one parameter.
  • The return type must be void.

Example

Here is an example of a valid parameter type declaration:


public interface MyParameter {
    String getValue();
    void setValue(String value);

    boolean isFlag();
    void setFlag(boolean value);
}

Return

The type of the parameter.