use of com.datastax.oss.driver.shaded.guava.common.reflect.TypeResolver in project java-driver by datastax.
the class GenericType method where.
/**
* Substitutes a free type variable with an actual type. See {@link GenericType this class's
* javadoc} for an example.
*/
@NonNull
public final <X> GenericType<T> where(@NonNull GenericTypeParameter<X> freeVariable, @NonNull GenericType<X> actualType) {
TypeResolver resolver = new TypeResolver().where(freeVariable.getTypeVariable(), actualType.__getToken().getType());
Type resolvedType = resolver.resolveType(this.token.getType());
@SuppressWarnings("unchecked") TypeToken<T> resolvedToken = (TypeToken<T>) TypeToken.of(resolvedType);
return new GenericType<>(resolvedToken);
}
Aggregations