org.springframework.data.util

## Class ParameterTypes

- java.lang.Object
- - org.springframework.data.util.ParameterTypes

    public class ParameterTypes
    extends Object

Abstraction over a list of parameter value types. Allows to check whether a list of parameter values with the given type setup is a candidate for the invocation of a given `Method` (see `areValidFor(Method)`). This is necessary to properly match parameter values against methods declaring varargs arguments. The implementation favors direct matches and only computes the alternative sets of types to be considered if the primary one doesn't match.

Since:
  2.1.7
Author:
  Oliver Drotbohm

### Constructor Summary

Constructors
Constructor and Description
`ParameterTypes(List<TypeDescriptor> types, Lazy<Collection<ParameterTypes>> alternatives)`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`boolean` `areValidFor(Method method)` Returns whether the parameter types are valid for the given `Method`.
`boolean` `equals(Object o)`
`boolean` `exactlyMatchParametersOf(Method method)` Returns whether the current parameter types match the given `Method`'s parameters exactly, i.e. they're equal, not only assignable.
`protected Optional<ParameterTypes>` `getParent()`
`protected Optional<ParameterTypes>` `getParent(TypeDescriptor tail)`
`int` `hashCode()`
`static ParameterTypes` `of(List<TypeDescriptor> types)` Returns the `ParameterTypes` for the given list of `TypeDescriptor`s.
`String` `toString()`
`protected Optional<ParameterTypes>` `withLastVarArgs()`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### ParameterTypes

    public ParameterTypes(List<TypeDescriptor> types,
                          Lazy<Collection<ParameterTypes>> alternatives)

### Method Detail

#### of

    public static ParameterTypes of(List<TypeDescriptor> types)

Returns the `ParameterTypes` for the given list of `TypeDescriptor`s.

Parameters:
  `types` - must not be null.
Returns:

#### areValidFor

    public boolean areValidFor(Method method)

Returns whether the parameter types are valid for the given `Method`. That means, a parameter value list with the given type arrangement is a valid list to invoke the given method.

Parameters:
  `method` - must not be null.
Returns:

#### exactlyMatchParametersOf

    public boolean exactlyMatchParametersOf(Method method)

Returns whether the current parameter types match the given `Method`'s parameters exactly, i.e. they're equal, not only assignable.

Parameters:
  `method` - must not be null.
Returns:

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

#### getParent

    protected Optional<ParameterTypes> getParent()

#### getParent

    protected final Optional<ParameterTypes> getParent(TypeDescriptor tail)

#### withLastVarArgs

    protected Optional<ParameterTypes> withLastVarArgs()

#### equals

    public boolean equals(@Nullable
                          Object o)

Overrides:
  `equals` in class `Object`

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`