@Test public void testReadEmptyDocument() throws Exception { ModsDefinition root = new ModsDefinition(); PageMapper instance = new PageMapper(); Page result = instance.map(root); assertNotNull(result); assertEquals(null, result.getIndex()); assertEquals(null, result.getNumber()); assertEquals(null, result.getType()); assertEquals(null, result.getNote()); assertEquals(Collections.emptyList(), result.getIdentifiers()); }
@Override public Page map(ModsDefinition mods) { NodeLookup nlookup = new NodeLookup(mods); Page page = new Page(); page.setIdentifiers(identMap.map(mods)); page.setNumber(MapperUtils.toString(nlookup.getPageNumber(false))); page.setIndex(MapperUtils.toString(nlookup.getPageIndex(false))); Text note = nlookup.getNote(false); page.setNote(note == null ? null : note.getValue()); PartDefinition part = nlookup.getPart(false); page.setType(part == null ? null : part.getType()); return page; }
PageMapper implements Mapping.Mapper<Page> { @Override public Page map(ModsDefinition mods) { NodeLookup nlookup = new NodeLookup(mods); Page page = new Page(); page.setIdentifiers(identMap.map(mods)); page.setNumber(MapperUtils.toString(nlookup.getPageNumber(false))); page.setIndex(MapperUtils.toString(nlookup.getPageIndex(false))); Text note = nlookup.getNote(false); page.setNote(note == null ? null : note.getValue()); PartDefinition part = nlookup.getPart(false); page.setType(part == null ? null : part.getType()); return page; } }
PageMapper implements Mapping.Mapper<Page> { @Override public Page map(ModsDefinition mods) { NodeLookup nlookup = new NodeLookup(mods); Page page = new Page(); page.setIdentifiers(identMap.map(mods)); page.setNumber(MapperUtils.toString(nlookup.getPageNumber(false))); page.setIndex(MapperUtils.toString(nlookup.getPageIndex(false))); Text note = nlookup.getNote(false); page.setNote(note == null ? null : note.getValue()); PartDefinition part = nlookup.getPart(false); page.setType(part == null ? null : part.getType()); return page; }  }
PageMapper implements Mapping.Mapper<Page> { @Override public Page map(ModsDefinition mods) { NodeLookup nlookup = new NodeLookup(mods); Page page = new Page(); page.setIdentifiers(identMap.map(mods)); page.setNumber(MapperUtils.toString(nlookup.getPageNumber(false))); page.setIndex(MapperUtils.toString(nlookup.getPageIndex(false))); Text note = nlookup.getNote(false); page.setNote(note == null ? null : note.getValue()); PartDefinition part = nlookup.getPart(false); page.setType(part == null ? null : part.getType()); return page; }  @Override Page map(ModsDefinition mods); @Override ModsDefinition map(ModsDefinition mods, Page page); void updatePage(ModsDefinition mods, String pageIndex, String pageNumber, String pageType); }
PageMapper implements Mapping.Mapper<Page> { @Override public Page map(ModsDefinition mods) { NodeLookup nlookup = new NodeLookup(mods); Page page = new Page(); page.setIdentifiers(identMap.map(mods)); page.setNumber(MapperUtils.toString(nlookup.getPageNumber(false))); page.setIndex(MapperUtils.toString(nlookup.getPageIndex(false))); Text note = nlookup.getNote(false); page.setNote(note == null ? null : note.getValue()); PartDefinition part = nlookup.getPart(false); page.setType(part == null ? null : part.getType()); return page; }  @Override Page map(ModsDefinition mods); @Override ModsDefinition map(ModsDefinition mods, Page page); void updatePage(ModsDefinition mods, String pageIndex, String pageNumber, String pageType);  }