Home
last modified time | relevance | path

Searched refs:TypeToken (Results 1 – 25 of 36) sorted by relevance

12

/external/guava/guava-tests/test/com/google/common/reflect/
DTypeTokenTest.java59 TypeToken<List<String>> a = new TypeToken<List<String>>() {}; in testValueEqualityNotInstanceEquality()
60 TypeToken<List<String>> b = new TypeToken<List<String>>() {}; in testValueEqualityNotInstanceEquality()
66 new TypeToken<T>() {}; in testVariableTypeTokenNotAllowed() method
72 TypeToken<List<String>> token = new TypeToken<List<String>>() {}; in testRawTypeIsCorrect()
77 TypeToken<List<String>> token = new TypeToken<List<String>>() {}; in testTypeIsCorrect()
83 TypeToken<List> token = TypeToken.of(List.class); in testGetClass()
84 assertEquals(new TypeToken<List>() {}, token); in testGetClass()
88 TypeToken<?> t = TypeToken.of(StringList.class.getGenericInterfaces()[0]); in testGetType()
89 assertEquals(new TypeToken<List<String>>() {}, t); in testGetType()
94 TypeToken<Local<String>> type = new TypeToken<Local<String>>() {}; in testNonStaticLocalClass()
[all …]
DImmutableTypeToInstanceMapTest.java55 public Map<TypeToken, Object> create(Object... elements) { in suite()
59 Entry<TypeToken, Object> entry = (Entry<TypeToken, Object>) object; in suite()
89 assertEquals(0, (int) map.getInstance(TypeToken.of(Integer.class))); in testPrimitiveAndWrapper()
91 assertEquals(1, (int) map.getInstance(TypeToken.of(int.class))); in testPrimitiveAndWrapper()
95 TypeToken<ImmutableList<Integer>> type = new TypeToken<ImmutableList<Integer>>() {}; in testParameterizedType()
106 TypeToken<ImmutableList<Integer>[]> type = new TypeToken<ImmutableList<Integer>[]>() {}; in testGeneriArrayType()
116 TypeToken<ImmutableList<?>> type = new TypeToken<ImmutableList<?>>() {}; in testWildcardType()
141 private <T> TypeToken<Iterable<T>> anyIterableType() { in anyIterableType()
142 return new TypeToken<Iterable<T>>() {}; in anyIterableType()
146 implements TestMapGenerator<TypeToken, Object> {
[all …]
DTypeTokenResolutionTest.java45 return new TypeToken<A>(getClass()) {}.getRawType(); in getClassA()
49 return new TypeToken<B>(getClass()) {}.getRawType(); in getClassB()
53 return new TypeToken<A[]>(getClass()) {}.getRawType(); in getArrayClassA()
57 return new TypeToken<A[]>(getClass()) {}.getType(); in getArrayTypeA()
61 return new TypeToken<B[]>(getClass()) {}.getRawType(); in getArrayClassB()
89 assertEquals(new TypeToken<String[]>() {}.getType(), foo.getArrayTypeA()); in testPartialSpecialization()
143 TypeToken.of(IntegerStringFunction.class).resolveType(fType)
148 assertEquals(new TypeToken<List<String>>() {}.getType(),
149 TypeToken.of(IntegerStringFunction.class).resolveType(predicateParameterType)
163 return new TypeToken<X>(getClass()) {}.getRawType();
[all …]
DMutableTypeToInstanceMapTest.java65 public Map<TypeToken, Object> create(Object... elements) { in suite()
69 Entry<TypeToken, Object> entry = (Entry<TypeToken, Object>) object; in suite()
97 map.put(TypeToken.of(Integer.class), new Integer(5)); in testPutThrows()
104 map.putAll(ImmutableMap.of(TypeToken.of(Integer.class), new Integer(5))); in testPutAllThrows()
111 assertEquals(TypeToken.of(String.class), map.entrySet().iterator().next().getKey()); in testEntrySetMutationThrows()
123 assertEquals(TypeToken.of(String.class), entry.getKey()); in testEntrySetToArrayMutationThrows()
135 assertEquals(TypeToken.of(String.class), entry.getKey()); in testEntrySetToTypedArrayMutationThrows()
151 assertEquals(7, (int) map.getInstance(TypeToken.of(Integer.class))); in testPutAndGetInstance()
158 map.putInstance((TypeToken) null, new Integer(1)); in testNull()
191 TypeToken<ImmutableList<Integer>> type = new TypeToken<ImmutableList<Integer>>() {}; in testParameterizedType()
[all …]
DInvokableTest.java69 assertEquals(ImmutableList.of(TypeToken.of(NullPointerException.class)), in testConstructor_exceptionTypes()
119 assertEquals(new TypeToken<Iterable<String>>() {}, delegate.getReturnType()); in testStaticMethod_returnType()
140 assertEquals(new TypeToken<Iterable<String>>() {}, parameters.get(1).getType()); in testStaticMethod_parameters()
159 .returning(new TypeToken<Iterable<String>>() {}); in testStaticMethod_returning()
160 assertEquals(new TypeToken<Iterable<String>>() {}, delegate.getReturnType()); in testStaticMethod_returning()
170 assertEquals(new TypeToken<Iterable<String>>() {}, delegate.getReturnType()); in testStaticMethod_returningRawType()
179 delegate.returning(new TypeToken<Iterable<Integer>>() {}); in testStaticMethod_invalidReturning()
186 assertEquals(new TypeToken<Iterable<String>>() {}, delegate.getReturnType()); in testInstanceMethod_returnType()
193 TypeToken.of(IllegalArgumentException.class), in testInstanceMethod_exceptionTypes()
194 TypeToken.of(NullPointerException.class)), in testInstanceMethod_exceptionTypes()
[all …]
/external/guava/guava-testlib/test/com/google/common/testing/
DFreshValueGeneratorTest.java64 import com.google.common.reflect.TypeToken;
141 Class.class, Type.class, TypeToken.class, in testFreshInstance()
169 assertFreshInstance(new TypeToken<Range<String>>() {}); in testRange()
173 assertFreshInstance(new TypeToken<ImmutableList<String>>() {}); in testImmutableList()
175 new FreshValueGenerator().generate(new TypeToken<ImmutableList<String>>() {})); in testImmutableList()
177 new FreshValueGenerator().generate(new TypeToken<ImmutableList<Integer>>() {})); in testImmutableList()
179 new FreshValueGenerator().generate(new TypeToken<ImmutableList<?>>() {})); in testImmutableList()
183 assertFreshInstance(new TypeToken<ImmutableSet<String>>() {}); in testImmutableSet()
185 new FreshValueGenerator().generate(new TypeToken<ImmutableSet<String>>() {})); in testImmutableSet()
187 new FreshValueGenerator().generate(new TypeToken<ImmutableSet<Number>>() {})); in testImmutableSet()
[all …]
DNullPointerTesterTest.java37 import com.google.common.reflect.TypeToken;
1017 TypeToken<? extends List<? super Number>> type, String s) { in checkArray()
1023 TypeToken<?> defaultType = (TypeToken<?>) getDefaultParameterValue(0); in check()
1024 assertTrue(new TypeToken<List<? super Number>>() {} in check()
1038 @SuppressWarnings("rawtypes") TypeToken type, String s) { in checkArray()
1044 TypeToken<?> defaultType = (TypeToken<?>) getDefaultParameterValue(0); in check()
1045 assertEquals(new TypeToken<Object>() {}, defaultType); in check()
/external/guava/guava/src/com/google/common/reflect/
DTypeToken.java95 public abstract class TypeToken<T> extends TypeCapture<T> implements Serializable { class
112 protected TypeToken() { in TypeToken() method in TypeToken
139 protected TypeToken(Class<?> declaringClass) { in TypeToken() method in TypeToken
148 private TypeToken(Type type) { in TypeToken() method in TypeToken
153 public static <T> TypeToken<T> of(Class<T> type) { in of()
158 public static TypeToken<?> of(Type type) { in of()
214 public final <X> TypeToken<T> where(TypeParameter<X> typeParam, TypeToken<X> typeArg) { in where()
238 public final <X> TypeToken<T> where(TypeParameter<X> typeParam, Class<X> typeArg) { in where()
249 public final TypeToken<?> resolveType(Type type) { in resolveType()
265 private TypeToken<?> resolveSupertype(Type type) { in resolveSupertype()
[all …]
DImmutableTypeToInstanceMap.java33 public final class ImmutableTypeToInstanceMap<B> extends ForwardingMap<TypeToken<? extends B>, B>
38 return new ImmutableTypeToInstanceMap<B>(ImmutableMap.<TypeToken<? extends B>, B>of()); in of()
64 private final ImmutableMap.Builder<TypeToken<? extends B>, B> mapBuilder
74 mapBuilder.put(TypeToken.of(key), value); in put()
82 public <T extends B> Builder<B> put(TypeToken<T> key, T value) { in put()
98 private final ImmutableMap<TypeToken<? extends B>, B> delegate;
100 private ImmutableTypeToInstanceMap(ImmutableMap<TypeToken<? extends B>, B> delegate) { in ImmutableTypeToInstanceMap()
104 @Override public <T extends B> T getInstance(TypeToken<T> type) { in getInstance()
113 @Override public <T extends B> T putInstance(TypeToken<T> type, T value) { in putInstance()
118 return trustedGet(TypeToken.of(type)); in getInstance()
[all …]
DMutableTypeToInstanceMap.java43 public final class MutableTypeToInstanceMap<B> extends ForwardingMap<TypeToken<? extends B>, B>
46 private final Map<TypeToken<? extends B>, B> backingMap = Maps.newHashMap();
51 return trustedGet(TypeToken.of(type)); in getInstance()
57 return trustedPut(TypeToken.of(type), value); in putInstance()
62 public <T extends B> T getInstance(TypeToken<T> type) { in getInstance()
68 public <T extends B> T putInstance(TypeToken<T> type, @Nullable T value) { in putInstance()
73 @Override public B put(TypeToken<? extends B> key, B value) { in put()
78 @Override public void putAll(Map<? extends TypeToken<? extends B>, ? extends B> map) { in putAll()
82 @Override public Set<Entry<TypeToken<? extends B>, B>> entrySet() { in entrySet()
86 @Override protected Map<TypeToken<? extends B>, B> delegate() { in delegate()
[all …]
DInvokable.java108 public final TypeToken<? extends R> getReturnType() { in getReturnType()
109 return (TypeToken<? extends R>) TypeToken.of(getGenericReturnType()); in getReturnType()
123 this, i, TypeToken.of(parameterTypes[i]), annotations[i])); in getParameters()
129 public final ImmutableList<TypeToken<? extends Throwable>> getExceptionTypes() { in getExceptionTypes()
130 ImmutableList.Builder<TypeToken<? extends Throwable>> builder = ImmutableList.builder(); in getExceptionTypes()
134 TypeToken<? extends Throwable> exceptionType = (TypeToken<? extends Throwable>) in getExceptionTypes()
135 TypeToken.of(type); in getExceptionTypes()
148 return returning(TypeToken.of(returnType)); in returning()
152 public final <R1 extends R> Invokable<T, R1> returning(TypeToken<R1> returnType) { in returning()
170 @Override public TypeToken<T> getOwnerType() { in getOwnerType()
[all …]
DTypeToInstanceMap.java48 public interface TypeToInstanceMap<B> extends Map<TypeToken<? extends B>, B> {
81 <T extends B> T getInstance(TypeToken<T> type); in getInstance()
91 <T extends B> T putInstance(TypeToken<T> type, @Nullable T value); in putInstance()
DParameter.java41 private final TypeToken<?> type;
47 TypeToken<?> type, in Parameter()
56 public TypeToken<?> getType() { in getType()
DElement.java48 public TypeToken<?> getOwnerType() { in getOwnerType()
49 return TypeToken.of(getDeclaringClass()); in getOwnerType()
/external/caliper/caliper/src/main/java/com/google/caliper/json/
DImmutableMultimapTypeAdapterFactory.java25 import com.google.common.reflect.TypeToken;
44 private static <K, V> TypeToken<Map<K, List<V>>> getMapOfListsToken( in getMapOfListsToken()
45 TypeToken<ListMultimap<K, V>> from) { in getMapOfListsToken()
48 TypeToken<K> keyType = (TypeToken<K>) TypeToken.of(rawType.getActualTypeArguments()[0]); in getMapOfListsToken()
50 TypeToken<V> valueType = (TypeToken<V>) TypeToken.of(rawType.getActualTypeArguments()[1]); in getMapOfListsToken()
51 return new TypeToken<Map<K, List<V>>>() {} in getMapOfListsToken()
56 private static <K, V> TypeToken<Map<K, Set<V>>> getMapOfSetsToken( in getMapOfSetsToken()
57 TypeToken<SetMultimap<K, V>> from) { in getMapOfSetsToken()
60 TypeToken<K> keyType = (TypeToken<K>) TypeToken.of(rawType.getActualTypeArguments()[0]); in getMapOfSetsToken()
62 TypeToken<V> valueType = (TypeToken<V>) TypeToken.of(rawType.getActualTypeArguments()[1]); in getMapOfSetsToken()
[all …]
DImmutableMapTypeAdapterFactory.java24 import com.google.gson.reflect.TypeToken;
40 @Override public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> typeToken) { in create()
47 com.google.common.reflect.TypeToken<ImmutableMap<?, ?>> betterToken = in create()
48 (com.google.common.reflect.TypeToken<ImmutableMap<?, ?>>) in create()
49 com.google.common.reflect.TypeToken.of(typeToken.getType()); in create()
52 TypeToken.get(betterToken.getSupertype(Map.class).getSubtype(HashMap.class) in create()
DImmutableListTypeAdatperFactory.java24 import com.google.gson.reflect.TypeToken;
40 @Override public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> typeToken) { in create()
47 com.google.common.reflect.TypeToken<ImmutableList<?>> betterToken = in create()
48 (com.google.common.reflect.TypeToken<ImmutableList<?>>) in create()
49 com.google.common.reflect.TypeToken.of(typeToken.getType()); in create()
52 TypeToken.get(betterToken.getSupertype(List.class).getSubtype(ArrayList.class) in create()
DNaturallySortedMapTypeAdapterFactory.java24 import com.google.gson.reflect.TypeToken;
45 @Override public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> typeToken) { in create()
52 com.google.common.reflect.TypeToken<SortedMap<?, ?>> betterToken = in create()
53 (com.google.common.reflect.TypeToken<SortedMap<?, ?>>) in create()
54 com.google.common.reflect.TypeToken.of(typeToken.getType()); in create()
57 TypeToken.get(betterToken.getSupertype(Map.class).getType())); in create()
/external/guava/guava-testlib/src/com/google/common/testing/
DNullPointerTester.java33 import com.google.common.reflect.TypeToken;
280 for (Class<?> type : TypeToken.of(cls).getTypes().classes().rawTypes()) { in getVisibleMethods()
375 private <T> T getDefaultValue(TypeToken<T> type) { in getDefaultValue()
394 if (type.getRawType() == TypeToken.class) { in getDefaultValue()
401 TypeToken<?> convertFromType = type.resolveType( in getDefaultValue()
403 TypeToken<?> convertToType = type.resolveType( in getDefaultValue()
416 final TypeToken<F> convertFromType, final TypeToken<T> convertToType) { in defaultConverter()
425 private /*static*/ <S> S doConvert(TypeToken<S> type) { in defaultConverter()
431 private static TypeToken<?> getFirstTypeParameter(Type type) {
433 return TypeToken.of(
[all …]
DDummyProxy.java26 import com.google.common.reflect.TypeToken;
46 final <T> T newProxy(TypeToken<T> interfaceType) { in newProxy()
61 abstract <R> R dummyReturnValue(TypeToken<R> returnType); in dummyReturnValue()
64 private final TypeToken<?> interfaceType;
66 DummyHandler(TypeToken<?> interfaceType) { in DummyHandler()
107 return new DummyHandler(TypeToken.of(interfaceType.getRawType())); in writeReplace()
DClassSanityTester.java38 import com.google.common.reflect.TypeToken;
310 List<? extends Invokable<?, ?>> factories = Lists.reverse(getFactories(TypeToken.of(cls))); in doTestEquals()
360 TypeToken<T> type = TypeToken.of(cls); in instantiate()
656 return getDummyValue(TypeToken.of(interfaceType).method(method).getReturnType()); in newFreshValueGenerator()
684 private static <T> ImmutableList<Invokable<?, ? extends T>> getFactories(TypeToken<T> type) { in getFactories()
732 private <T> T getDummyValue(TypeToken<T> type) { in getDummyValue()
811 @Override <R> R dummyReturnValue(TypeToken<R> returnType) { in dummyReturnValue()
/external/swiftshader/third_party/llvm-7.0/llvm/tools/llvm-rc/
DResourceScriptParser.cpp62 ASSIGN_OR_RETURN(TypeToken, readTypeOrName()); in parseSingleResource()
67 if (TypeToken->equalsLower("ACCELERATORS")) in parseSingleResource()
69 else if (TypeToken->equalsLower("BITMAP")) in parseSingleResource()
71 else if (TypeToken->equalsLower("CURSOR")) in parseSingleResource()
73 else if (TypeToken->equalsLower("DIALOG")) in parseSingleResource()
75 else if (TypeToken->equalsLower("DIALOGEX")) in parseSingleResource()
77 else if (TypeToken->equalsLower("HTML")) in parseSingleResource()
79 else if (TypeToken->equalsLower("ICON")) in parseSingleResource()
81 else if (TypeToken->equalsLower("MENU")) in parseSingleResource()
83 else if (TypeToken->equalsLower("RCDATA")) in parseSingleResource()
[all …]
/external/okhttp/samples/simple-client/src/main/java/com/squareup/okhttp/sample/
DOkHttpContributors.java4 import com.google.gson.reflect.TypeToken;
17 private static final TypeToken<List<Contributor>> CONTRIBUTORS =
18 new TypeToken<List<Contributor>>() {
/external/desugar/java/com/google/devtools/common/options/
DGenericTypeHelper.java18 import com.google.common.reflect.TypeToken;
127 return TypeToken.of(to).isSupertypeOf(from); in isAssignableFrom()
/external/guava/guava/src/com/google/common/eventbus/
DAnnotatedSubscriberFinder.java28 import com.google.common.reflect.TypeToken;
114 Set<? extends Class<?>> supers = TypeToken.of(clazz).getTypes().rawTypes(); in getAnnotatedMethodsInternal()

12