@Test public void testBuildId() { Map<String, Object> map = new HashMap<>(); map.put("id", 12); map.put("type", "artist"); DocumentId buildId = builder.buildId(map); Assert.assertEquals("id: 12, type: 'artist'", buildId.toCypherFilter()); }
@Override public DocumentId buildId(Map<String,Object> obj) { Object typeObj = obj.get(DocumentIdTypeId.TYPE); Object idObj = obj.get(DocumentIdTypeId.ID); Validate.notNull(typeObj, "every object must have "+DocumentIdTypeId.TYPE+": "+obj); Validate.notNull(idObj, "every object must have "+DocumentIdTypeId.ID+": "+obj); return new DocumentIdTypeId(typeObj, idObj); }
DocumentIdBuilderTypeId implements DocumentIdBuilder { @Override public DocumentId buildId(Map<String,Object> obj) { Object typeObj = obj.get(DocumentIdTypeId.TYPE); Object idObj = obj.get(DocumentIdTypeId.ID); Validate.notNull(typeObj, "every object must have "+DocumentIdTypeId.TYPE+": "+obj); Validate.notNull(idObj, "every object must have "+DocumentIdTypeId.ID+": "+obj); return new DocumentIdTypeId(typeObj, idObj); } }
DocumentIdBuilderTypeId implements DocumentIdBuilder { @Override public DocumentId buildId(Map<String,Object> obj) { Object typeObj = obj.get(DocumentIdTypeId.TYPE); Object idObj = obj.get(DocumentIdTypeId.ID); Validate.notNull(typeObj, "every object must have "+DocumentIdTypeId.TYPE+": "+obj); Validate.notNull(idObj, "every object must have "+DocumentIdTypeId.ID+": "+obj); return new DocumentIdTypeId(typeObj, idObj); }  }
DocumentIdBuilderTypeId implements DocumentIdBuilder { @Override public DocumentId buildId(Map<String,Object> obj) { Object typeObj = obj.get(DocumentIdTypeId.TYPE); Object idObj = obj.get(DocumentIdTypeId.ID); Validate.notNull(typeObj, "every object must have "+DocumentIdTypeId.TYPE+": "+obj); Validate.notNull(idObj, "every object must have "+DocumentIdTypeId.ID+": "+obj); return new DocumentIdTypeId(typeObj, idObj); }  @Override DocumentId buildId(Map<String,Object> obj); @Override void init(Map<String, String> configuration); }
DocumentIdBuilderTypeId implements DocumentIdBuilder { @Override public DocumentId buildId(Map<String,Object> obj) { Object typeObj = obj.get(DocumentIdTypeId.TYPE); Object idObj = obj.get(DocumentIdTypeId.ID); Validate.notNull(typeObj, "every object must have "+DocumentIdTypeId.TYPE+": "+obj); Validate.notNull(idObj, "every object must have "+DocumentIdTypeId.ID+": "+obj); return new DocumentIdTypeId(typeObj, idObj); }  @Override DocumentId buildId(Map<String,Object> obj); @Override void init(Map<String, String> configuration);  }