@VisibleForTesting <T> Invokable<T, T> getDeserializer(TypeToken<T> token) { return tryFind(constructors(token), hasMarker).orNull(); }
@VisibleForTesting <T> Invokable<T, T> getDeserializer(TypeToken<T> token) { return tryFind(constructors(token), hasMarker).orNull(); }
@VisibleForTesting <T> Invokable<T, T> getDeserializer(TypeToken<T> token) { return tryFind(constructors(token), hasMarker).orNull(); }
@VisibleForTesting <T> Invokable<T, T> getDeserializer(TypeToken<T> token) { return tryFind(constructors(token), hasMarker).orNull(); }
@VisibleForTesting <T> Invokable<T, T> getDeserializer(TypeToken<T> token) { return tryFind(constructors(token), hasMarker).orNull(); }
@VisibleForTesting <T> Invokable<T, T> getDeserializer(TypeToken<T> token) { return tryFind(constructors(token), hasMarker).orNull(); }
public void testConstructors() { Set<String> ctorParams = FluentIterable.from(constructors(TypeToken.of(HashSet.class))) .transform(new Function<Invokable<?, ?>, Iterable<Parameter>>() { public Iterable<Parameter> apply(Invokable<?, ?> input) { return input.getParameters(); } }).transform(toStringFunction()).toSet(); assertEquals(ctorParams, ImmutableSet.of("[]", "[java.util.Collection<? extends E> arg0]", "[int arg0, float arg1]", "[int arg0]", "[int arg0, float arg1, boolean arg2]")); }
public void testConstructors() { Set<String> ctorParams = FluentIterable.from(constructors(TypeToken.of(HashSet.class))) .transform(new Function<Invokable<?, ?>, Iterable<Parameter>>() { public Iterable<Parameter> apply(Invokable<?, ?> input) { return input.getParameters(); } }).transform(toStringFunction()).toSet(); assertEquals(ctorParams, ImmutableSet.of("[]", "[java.util.Collection<? extends E> arg0]", "[int arg0, float arg1]", "[int arg0]", "[int arg0, float arg1, boolean arg2]")); }
for (Invokable<?, ?> target : constructors(TypeToken.of(f.getDeclaringClass().getSuperclass()))) { SerializedNames names = target.getAnnotation(SerializedNames.class); if (names != null && target.isStatic()) { // == factory method
for (Invokable<?, ?> target : constructors(TypeToken.of(f.getDeclaringClass().getSuperclass()))) { SerializedNames names = target.getAnnotation(SerializedNames.class); if (names != null && target.isStatic()) { // == factory method
for (Invokable<?, ?> target : constructors(TypeToken.of(f.getDeclaringClass().getSuperclass()))) { SerializedNames names = target.getAnnotation(SerializedNames.class); if (names != null && target.isStatic()) { // == factory method
public void testConstructorsReturnsFactoryMethods() { Set<String> ctorParams = FluentIterable.from(constructors(TypeToken.of(MyValue.class))) .transform(new Function<Invokable<?, ?>, Iterable<Parameter>>() { public Iterable<Parameter> apply(Invokable<?, ?> input) { return input.getParameters(); } }).transform(toStringFunction()).toSet(); assertEquals(ctorParams, ImmutableSet.of("[]", "[java.lang.String arg0]")); }