private static void addResourceIdentifierSet( SolrInputDocument doc, Collection<DcsResourceIdentifier> set) { if (set == null || set.size() == 0) { return; } for (DcsResourceIdentifier id : set) { setadd(doc, ResourceIdentifierField.AUTHORITY, id.getAuthorityId()); setadd(doc, ResourceIdentifierField.TYPE, id.getTypeId()); setadd(doc, ResourceIdentifierField.VALUE, id.getIdValue()); } }
private static Set<DcsResourceIdentifier> getResourceIdentifierSet(SolrDocument doc) { Set<DcsResourceIdentifier> idSet = new HashSet<DcsResourceIdentifier>(); String[] authorities = setgetAll(doc, ResourceIdentifierField.AUTHORITY); String[] types = setgetAll(doc, ResourceIdentifierField.TYPE); String[] values = setgetAll(doc, ResourceIdentifierField.VALUE); for (int i = 0; i < values.length; i++) { DcsResourceIdentifier id = new DcsResourceIdentifier(); id.setAuthorityId(authorities[i]); id.setTypeId(types[i]); id.setIdValue(values[i]); idSet.add(id); } return idSet; }