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

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

Introduction

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

Prototype

public final <X> TypeToken<T> where(TypeParameter<X> typeParam, Class<X> typeArg) 

Source Link

Document

Returns a new TypeToken where type variables represented by typeParam are substituted by typeArg .

Usage

From source file:org.zalando.riptide.Capture.java

static <T> TypeToken<List<T>> listOf(final TypeToken<T> entityType) {
    final TypeToken<List<T>> listType = new TypeToken<List<T>>() {
    };/*from  w  ww .j av  a 2 s  .  c o  m*/

    final TypeParameter<T> elementType = new TypeParameter<T>() {
    };

    return listType.where(elementType, entityType);
}