/** * Get a single URI endpoint * @param epr endpoint * @return the uri of the first entry in the address list. Null if the endpoint * itself is null * @throws InvalidRecordException if the type is wrong, there are no addresses * or the payload ill-formatted */ public static List<String> retrieveAddressesUriType(Endpoint epr) throws InvalidRecordException { if (epr == null) { return null; } requireAddressType(ADDRESS_URI, epr); List<Map<String, String>> addresses = epr.addresses; if (addresses.size() < 1) { throw new InvalidRecordException(epr.toString(), "No addresses in endpoint"); } List<String> results = new ArrayList<String>(addresses.size()); for (Map<String, String> address : addresses) { results.add(getAddressField(address, ADDRESS_URI)); } return results; }
/** * Get a single URI endpoint * @param epr endpoint * @return the uri of the first entry in the address list. Null if the endpoint * itself is null * @throws InvalidRecordException if the type is wrong, there are no addresses * or the payload ill-formatted */ public static List<String> retrieveAddressesUriType(Endpoint epr) throws InvalidRecordException { if (epr == null) { return null; } requireAddressType(ADDRESS_URI, epr); List<Map<String, String>> addresses = epr.addresses; if (addresses.size() < 1) { throw new InvalidRecordException(epr.toString(), "No addresses in endpoint"); } List<String> results = new ArrayList<String>(addresses.size()); for (Map<String, String> address : addresses) { results.add(getAddressField(address, ADDRESS_URI)); } return results; }