Package org.apache.sis.xml
Interface IdentifierMap
-
public interface IdentifierMap extends Map<Citation,String>
A map view of some or all identifiers in an identified object. Each map entry is associated to anIdentifierwhere key is the identifier authority and the value is the identifier code.Some XML identifiers are difficult to handle as
Identifierobjects. Those identifiers are rather handled using specialized classes likeXLink. ThisIdentifierMapinterface mirrors the standardgetandputmethods with specialized methods, in order to fetch and store identifiers as objects of the specialized class.- Since:
- 0.3
- See Also:
IdentifiedObject.getIdentifierMap()
Defined in the
sis-metadatamodule
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> TgetSpecialized(IdentifierSpace<T> authority)Returns the identifier associated to the given namespace, ornullif this map contains no mapping of the specialized type for the namespace.<T> TputSpecialized(IdentifierSpace<T> authority, T value)Associates the given identifier with the given namespace in this map (optional operation).-
Methods inherited from interface Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
-
-
-
Method Detail
-
getSpecialized
<T> T getSpecialized(IdentifierSpace<T> authority)
Returns the identifier associated to the given namespace, ornullif this map contains no mapping of the specialized type for the namespace.- Type Parameters:
T- the identifier type.- Parameters:
authority- the namespace whose associated identifier is to be returned.- Returns:
- the identifier to which the given namespace is mapped, or
nullif this map contains no mapping for the namespace.
-
putSpecialized
<T> T putSpecialized(IdentifierSpace<T> authority, T value) throws UnsupportedOperationException
Associates the given identifier with the given namespace in this map (optional operation). If the map previously contained a mapping for the namespace, then the old value is replaced by the specified value.- Type Parameters:
T- the identifier type.- Parameters:
authority- the namespace with which the given identifier is to be associated.value- the identifier to be associated with the given namespace.- Returns:
- the previous identifier associated with
authority, ornullif there was no mapping of the specialized type forauthority. - Throws:
UnsupportedOperationException- if the identifier map is unmodifiable.
-
-