public class TypeBounds
extends java.lang.Object
Constructor and Description |
---|
TypeBounds() |
Modifier and Type | Method and Description |
---|---|
java.lang.reflect.Type |
best(java.lang.Class<?> rawClass,
java.util.List<java.lang.reflect.ParameterizedType> parameterizations)
Given a number of candidate parameterizations of a given class, derive the
most specific possible parameterization which is a supertype of all
candidates according to the Java 8 language specification regarding type
inference.
|
java.lang.reflect.Type |
greatestLowerBound(java.util.Collection<? extends java.lang.reflect.Type> lowerBounds)
Derive the greatest lower bound for a set of types, as defined in the Java
language specification.
|
java.lang.reflect.Type |
greatestLowerBound(java.lang.reflect.Type... lowerBounds)
|
java.lang.reflect.Type |
leastContainingArgument(java.lang.reflect.Type argumentU,
java.lang.reflect.Type argumentV)
Fetch the least containing argument of type type arguments according to the
Java 8 language specification.
|
java.lang.reflect.Type |
leastUpperBound(java.util.Collection<java.lang.reflect.Type> upperBounds)
Derive the least upper bound for a set of types, as defined in the Java
language specification.
|
java.lang.reflect.Type |
leastUpperBound(java.lang.reflect.Type... upperBounds)
|
public java.lang.reflect.Type leastUpperBound(java.lang.reflect.Type... upperBounds)
upperBounds
- Forwards to upperBounds
parameter.public java.lang.reflect.Type leastUpperBound(java.util.Collection<java.lang.reflect.Type> upperBounds)
upperBounds
- A collection of types representing the upper bounds of an unknown
type.public java.lang.reflect.Type best(java.lang.Class<?> rawClass, java.util.List<java.lang.reflect.ParameterizedType> parameterizations)
rawClass
- the class to be parameterizedparameterizations
- the candidate parameterizationspublic java.lang.reflect.Type leastContainingArgument(java.lang.reflect.Type argumentU, java.lang.reflect.Type argumentV)
argumentU
- the first argumentargumentV
- the second argumentpublic java.lang.reflect.Type greatestLowerBound(java.lang.reflect.Type... lowerBounds)
lowerBounds
- Forwards to lowerBounds
parameter.public java.lang.reflect.Type greatestLowerBound(java.util.Collection<? extends java.lang.reflect.Type> lowerBounds)
lowerBounds
- A collection of types representing the lower bounds of an unknown
type.