@Test public void testFindLayoutDefinition() { Optional<LinkkiLayoutDefinition> layoutDefinition = LayoutAnnotationReader.findLayoutDefinition(DummyPmo.class); assertThat(layoutDefinition, is(present())); assertThat(layoutDefinition.get(), is(instanceOf(DummyLayoutDefinition.class))); assertThat(LayoutAnnotationReader.findLayoutDefinition(String.class), is(absent())); }
public static Optional<LinkkiLayoutDefinition> findLayoutDefinition(AnnotatedElement annotatedElement) { return LINKKI_LAYOUT_ANNOTATION .findAnnotatedAnnotationsOn(annotatedElement) .reduce(LINKKI_LAYOUT_ANNOTATION.onlyOneOn(annotatedElement)) .map(annotation -> getLayoutDefinition(annotation, annotatedElement)); }
LayoutAnnotationReader { public static Optional<LinkkiLayoutDefinition> findLayoutDefinition(AnnotatedElement annotatedElement) { return LINKKI_LAYOUT_ANNOTATION .findAnnotatedAnnotationsOn(annotatedElement) .reduce(LINKKI_LAYOUT_ANNOTATION.onlyOneOn(annotatedElement)) .map(annotation -> getLayoutDefinition(annotation, annotatedElement)); } }
LayoutAnnotationReader { public static Optional<LinkkiLayoutDefinition> findLayoutDefinition(AnnotatedElement annotatedElement) { return LINKKI_LAYOUT_ANNOTATION .findAnnotatedAnnotationsOn(annotatedElement) .reduce(LINKKI_LAYOUT_ANNOTATION.onlyOneOn(annotatedElement)) .map(annotation -> getLayoutDefinition(annotation, annotatedElement)); } private  LayoutAnnotationReader(); }
LayoutAnnotationReader { public static Optional<LinkkiLayoutDefinition> findLayoutDefinition(AnnotatedElement annotatedElement) { return LINKKI_LAYOUT_ANNOTATION .findAnnotatedAnnotationsOn(annotatedElement) .reduce(LINKKI_LAYOUT_ANNOTATION.onlyOneOn(annotatedElement)) .map(annotation -> getLayoutDefinition(annotation, annotatedElement)); } private  LayoutAnnotationReader(); static boolean isLayoutDefinition(@CheckForNull Annotation annotation); static Optional<LinkkiLayoutDefinition> findLayoutDefinition(AnnotatedElement annotatedElement); }
LayoutAnnotationReader { public static Optional<LinkkiLayoutDefinition> findLayoutDefinition(AnnotatedElement annotatedElement) { return LINKKI_LAYOUT_ANNOTATION .findAnnotatedAnnotationsOn(annotatedElement) .reduce(LINKKI_LAYOUT_ANNOTATION.onlyOneOn(annotatedElement)) .map(annotation -> getLayoutDefinition(annotation, annotatedElement)); } private  LayoutAnnotationReader(); static boolean isLayoutDefinition(@CheckForNull Annotation annotation); static Optional<LinkkiLayoutDefinition> findLayoutDefinition(AnnotatedElement annotatedElement);  }