public static IdentifierData convert(Collection<IdentifierValueKey> valueCollection) { IdentifierData result = null; if (valueCollection != null && valueCollection.size() > 0) { result = new IdentifierData(); Map<String, KeyData> values = new HashMap<String, KeyData>(); result.setValues(values); for (IdentifierValueKey vk : valueCollection) { values.put(vk.getKey(), convert(vk)); } } return result; }
public static IdentifierMetadata convert(URI localIdentifier, IdentifierData ivalues) { IdentifierMetadata md = new IdentifierMetadata(); md.setLocalIdentifier(localIdentifier); List<IdentifierValueKey> values = new ArrayList<IdentifierValueKey>(); md.setValues(values); if (ivalues != null) { String[] keys = ivalues.getKeys(); for (String key : keys) { values.add(IdentifierUtil.convert(key, ivalues.getValues(key))); } } return md; }