public static Integer parseItemLayoutId(Class<? extends ItemViewHolder> itemViewHolderClass) { Integer itemLayoutId = ClassAnnotationParser.getLayoutId(itemViewHolderClass); if (itemLayoutId == null) { throw new LayoutIdMissingException(); } return itemLayoutId; }
@Test public void testGetLayoutId() throws Exception{ Integer layoutId = ClassAnnotationParser.getLayoutId(ItemViewHolderWithLayoutId.class); Assert.assertTrue(layoutId.equals(LAYOUT_ID)); }
@Test public void testGetLayoutIdWithoutAnnotation() throws Exception{ Integer layoutId = ClassAnnotationParser.getLayoutId(ItemViewHolderWithoutLayoutId.class); Assert.assertNull(layoutId); }