Class FullyQualifiedNamePlusUuidTopiaIdFactory
java.lang.Object
org.nuiton.topia.persistence.internal.FullyQualifiedNamePlusUuidTopiaIdFactory
- All Implemented Interfaces:
Serializable,TopiaIdFactory
- Direct Known Subclasses:
DefaultTopiaIdFactory
Default implementation of
TopiaIdFactory. Generates a FQN followed by a random UUID.- Since:
- 3.0
- Author:
- Brendan Le Ny - bleny@codelutin.com
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<E extends TopiaEntity>
Class<E>getClassName(String topiaId) getRandomPart(String topiaId) boolean<E extends TopiaEntity>
StringnewTopiaId(Class<E> entityClass, String randomPart) Builds a new topiaId for the given entity type and the given random part.<E extends TopiaEntity>
StringnewTopiaId(Class<E> entityClass, TopiaEntity topiaEntity) Generates a new topiaId for the given entity type and the given entity.
-
Constructor Details
-
FullyQualifiedNamePlusUuidTopiaIdFactory
public FullyQualifiedNamePlusUuidTopiaIdFactory()
-
-
Method Details
-
newTopiaId
Description copied from interface:TopiaIdFactoryGenerates a new topiaId for the given entity type and the given entity.- Specified by:
newTopiaIdin interfaceTopiaIdFactory- Type Parameters:
E- type of entity- Parameters:
entityClass- type of entity (must be a not null interface)topiaEntity- the entity on which we want to generate the id (must be not null)- Returns:
- the new topiaId for the given entity
-
newTopiaId
Description copied from interface:TopiaIdFactoryBuilds a new topiaId for the given entity type and the given random part.- Specified by:
newTopiaIdin interfaceTopiaIdFactory- Type Parameters:
E- type of entity- Parameters:
entityClass- type of entity (must be a not null interface)randomPart- the random part of the topiaId- Returns:
- the new topiaId
-
getClassName
- Specified by:
getClassNamein interfaceTopiaIdFactory- Type Parameters:
E- type of the entity- Parameters:
topiaId- the topiaId to inspect- Returns:
- the FQN part of the topiaId
-
getSeparator
- Specified by:
getSeparatorin interfaceTopiaIdFactory- Returns:
- the separator between the FQN and the random part of any topiaId.
-
getRandomPart
- Specified by:
getRandomPartin interfaceTopiaIdFactory- Parameters:
topiaId- the topiaId to inspect- Returns:
- the random part of the topiaId
-
isTopiaId
- Specified by:
isTopiaIdin interfaceTopiaIdFactory- Parameters:
str- FIXME- Returns:
- true if given argument is a well formatted topiaId
-