Example usage for com.google.common.reflect TypeToken getSubtype

List of usage examples for com.google.common.reflect TypeToken getSubtype

Introduction

In this page you can find the example usage for com.google.common.reflect TypeToken getSubtype.

Prototype

public final TypeToken<? extends T> getSubtype(Class<?> subclass) 

Source Link

Document

Returns subtype of this with subclass as the raw class.

Usage

From source file:org.immutables.eventual.Providers.java

@SuppressWarnings("unchecked")
TypeLiteral<ListenableFuture<?>> futureTypeLiteralFrom(TypeToken<?> type) {
    return (TypeLiteral<ListenableFuture<?>>) TypeLiteral
            .get((LISTENABLE_FUTURE.isSupertypeOf(type) ? type.getSubtype(ListenableFuture.class)
                    : wrapAsListenableFuture(type)).getType());
}