public class ImmutableNameRepository extends java.lang.Object implements NameRepository
Map. Resolves the name of an object using the Map
specified in the constructor. In case no name can be found within the map, then null is returned.nameFor(Object)| Constructor and Description |
|---|
ImmutableNameRepository(java.util.Map<java.lang.Object,java.lang.String> objectNames)
Creates a new name repository backed by the given map.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.Map<java.lang.Object,java.lang.String> |
content() |
java.lang.String |
nameFor(java.lang.Object object)
Returns for the specified object.
|
public ImmutableNameRepository(java.util.Map<java.lang.Object,java.lang.String> objectNames)
objectNames - the mapping from objects to namespublic java.lang.String nameFor(java.lang.Object object)
NameRepositorynameFor in interface NameRepositoryobject - the object for which to retrieve the namnull if the object is not known by the repository.public java.util.Map<java.lang.Object,java.lang.String> content()