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)
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.Object,java.lang.String> |
content() |
static ImmutableNameRepository |
empty() |
static ImmutableNameRepository |
fromMap(java.util.Map<java.lang.Object,java.lang.String> objectNames) |
java.lang.String |
nameFor(java.lang.Object object)
Returns the name for the specified object or
null in case the repository does not know about the object. |
public static ImmutableNameRepository empty()
public static ImmutableNameRepository fromMap(java.util.Map<java.lang.Object,java.lang.String> objectNames)
public java.lang.String nameFor(java.lang.Object object)
NameRepository
null
in case the repository does not know about the object.nameFor
in interface NameRepository
object
- 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()