@Test public void testProviderOf() { assertThat(TypeLiterals.providerOf(String.class), equalTo(new TypeLiteral<Provider<String>>() { })); assertThat(TypeLiterals.providerOf(new TypeLiteral<Class<?>>() { }), equalTo(new TypeLiteral<Provider<Class<?>>>() { })); }
@SuppressWarnings("unchecked") public static <T> TypeLiteral<Provider<T>> providerOf(Class<T> type) { return (TypeLiteral<Provider<T>>)TypeLiteral.get(Types.newParameterizedType(Provider.class, type)); }
TypeLiterals { @SuppressWarnings("unchecked") public static <T> TypeLiteral<Provider<T>> providerOf(Class<T> type) { return (TypeLiteral<Provider<T>>)TypeLiteral.get(Types.newParameterizedType(Provider.class, type)); } }
TypeLiterals { @SuppressWarnings("unchecked") public static <T> TypeLiteral<Provider<T>> providerOf(Class<T> type) { return (TypeLiteral<Provider<T>>)TypeLiteral.get(Types.newParameterizedType(Provider.class, type)); } private  TypeLiterals(); }
TypeLiterals { @SuppressWarnings("unchecked") public static <T> TypeLiteral<Provider<T>> providerOf(Class<T> type) { return (TypeLiteral<Provider<T>>)TypeLiteral.get(Types.newParameterizedType(Provider.class, type)); } private  TypeLiterals(); @SuppressWarnings("unchecked") static TypeLiteral<List<T>> listOf(Class<T> type); @SuppressWarnings("unchecked") static TypeLiteral<List<T>> listOf(TypeLiteral<T> type); @SuppressWarnings("unchecked") static TypeLiteral<Set<T>> setOf(Class<T> type); @SuppressWarnings("unchecked") static TypeLiteral<Set<T>> setOf(TypeLiteral<T> type); @SuppressWarnings("unchecked") static TypeLiteral<Map<K, V>> mapOf(Class<K> keyType, Class<V> valueType); @SuppressWarnings("unchecked") static TypeLiteral<Map<K, V>> mapOf(Class<K> keyType, TypeLiteral<V> valueType); @SuppressWarnings("unchecked") static TypeLiteral<Map<K, V>> mapOf(TypeLiteral<K> keyType, Class<V> valueType); @SuppressWarnings("unchecked") static TypeLiteral<Map<K, V>> mapOf(TypeLiteral<K> keyType, TypeLiteral<V> valueType); @SuppressWarnings("unchecked") static TypeLiteral<Provider<T>> providerOf(Class<T> type); @SuppressWarnings("unchecked") static TypeLiteral<Provider<T>> providerOf(TypeLiteral<T> type); }
TypeLiterals { @SuppressWarnings("unchecked") public static <T> TypeLiteral<Provider<T>> providerOf(Class<T> type) { return (TypeLiteral<Provider<T>>)TypeLiteral.get(Types.newParameterizedType(Provider.class, type)); } private  TypeLiterals(); @SuppressWarnings("unchecked") static TypeLiteral<List<T>> listOf(Class<T> type); @SuppressWarnings("unchecked") static TypeLiteral<List<T>> listOf(TypeLiteral<T> type); @SuppressWarnings("unchecked") static TypeLiteral<Set<T>> setOf(Class<T> type); @SuppressWarnings("unchecked") static TypeLiteral<Set<T>> setOf(TypeLiteral<T> type); @SuppressWarnings("unchecked") static TypeLiteral<Map<K, V>> mapOf(Class<K> keyType, Class<V> valueType); @SuppressWarnings("unchecked") static TypeLiteral<Map<K, V>> mapOf(Class<K> keyType, TypeLiteral<V> valueType); @SuppressWarnings("unchecked") static TypeLiteral<Map<K, V>> mapOf(TypeLiteral<K> keyType, Class<V> valueType); @SuppressWarnings("unchecked") static TypeLiteral<Map<K, V>> mapOf(TypeLiteral<K> keyType, TypeLiteral<V> valueType); @SuppressWarnings("unchecked") static TypeLiteral<Provider<T>> providerOf(Class<T> type); @SuppressWarnings("unchecked") static TypeLiteral<Provider<T>> providerOf(TypeLiteral<T> type);  }