Package io.vertigo.commons.command
Class GenericUID<O>
- java.lang.Object
-
- io.vertigo.commons.command.GenericUID<O>
-
- Type Parameters:
O
- the type of entity
- All Implemented Interfaces:
Serializable
public final class GenericUID<O> extends Object implements Serializable
Représente l'identifiant ABSOLU d'une ressource. Une ressource posséde une définition (sa classe), et une clé. L'URI propose une URN, c'est é dire la transcription sous forme de chaine. L'URI peut étre recomposée é partir de cette URN. Le générique utilisé pour caractériser l'URI dépend de la ressource et non de la définition. Cela permet de créer des UID plus intuitive comme UIDqui est un identifiant de personne. - Author:
- pchretien
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
Serializable
getId()
String
getType()
int
hashCode()
static <O> GenericUID<O>
of(String urn)
Parses URI from URN.static <O> GenericUID<O>
of(String dname, Serializable id)
Builds an UID for an entity defined by - an id - a definitionString
toString()
String
urn()
Récupére l'URN é partir de l'URI.
-
-
-
Method Detail
-
of
public static <O> GenericUID<O> of(String urn)
Parses URI from URN.- Parameters:
urn
- URN to parse- Returns:
- URI to result
-
of
public static <O> GenericUID<O> of(String dname, Serializable id)
Builds an UID for an entity defined by - an id - a definition- Parameters:
definition
- the entity definitionid
- the entity id- Returns:
- the entity UID
-
getType
public String getType()
-
urn
public String urn()
Récupére l'URN é partir de l'URI. Une URN est la représentation unique d'une UID sous forme de chaine de caractéres. Cette chaine peut s'insérer telle que dans une URL en tant que paramétre et ne contient donc aucun caractére spécial. Une URN respecte la regex exprimée ci dessus.- Returns:
- URN de la ressource.
-
getId
public Serializable getId()
- Returns:
- the entity id
-
-