@Test public void testNoPresenter() throws Exception { assertNull(ReflectionPresenterFactory.fromViewClass(ViewNoPresenter.class)); }
@Nullable public static <P extends Presenter> ReflectionPresenterFactory<P> fromViewClass(Class<?> viewClass) { RequiresPresenter annotation = viewClass.getAnnotation(RequiresPresenter.class); Class<P> presenterClass = annotation == null ? null : (Class<P>)annotation.value(); return presenterClass == null ? null : new ReflectionPresenterFactory<>(presenterClass); }
ReflectionPresenterFactory implements PresenterFactory<P> { @Nullable public static <P extends Presenter> ReflectionPresenterFactory<P> fromViewClass(Class<?> viewClass) { RequiresPresenter annotation = viewClass.getAnnotation(RequiresPresenter.class); Class<P> presenterClass = annotation == null ? null : (Class<P>)annotation.value(); return presenterClass == null ? null : new ReflectionPresenterFactory<>(presenterClass); } }
ReflectionPresenterFactory implements PresenterFactory<P> { @Nullable public static <P extends Presenter> ReflectionPresenterFactory<P> fromViewClass(Class<?> viewClass) { RequiresPresenter annotation = viewClass.getAnnotation(RequiresPresenter.class); Class<P> presenterClass = annotation == null ? null : (Class<P>)annotation.value(); return presenterClass == null ? null : new ReflectionPresenterFactory<>(presenterClass); } ReflectionPresenterFactory(Class<P> presenterClass); }
ReflectionPresenterFactory implements PresenterFactory<P> { @Nullable public static <P extends Presenter> ReflectionPresenterFactory<P> fromViewClass(Class<?> viewClass) { RequiresPresenter annotation = viewClass.getAnnotation(RequiresPresenter.class); Class<P> presenterClass = annotation == null ? null : (Class<P>)annotation.value(); return presenterClass == null ? null : new ReflectionPresenterFactory<>(presenterClass); } ReflectionPresenterFactory(Class<P> presenterClass); @Nullable static ReflectionPresenterFactory<P> fromViewClass(Class<?> viewClass); @Override P createPresenter(); }
ReflectionPresenterFactory implements PresenterFactory<P> { @Nullable public static <P extends Presenter> ReflectionPresenterFactory<P> fromViewClass(Class<?> viewClass) { RequiresPresenter annotation = viewClass.getAnnotation(RequiresPresenter.class); Class<P> presenterClass = annotation == null ? null : (Class<P>)annotation.value(); return presenterClass == null ? null : new ReflectionPresenterFactory<>(presenterClass); } ReflectionPresenterFactory(Class<P> presenterClass); @Nullable static ReflectionPresenterFactory<P> fromViewClass(Class<?> viewClass); @Override P createPresenter();  }