public class LegacyTopiaIdFactory extends Object implements TopiaIdFactory
TopiaIdFactory with Topia 2.x and before ids.
Suitable if you already have a database and your application need
to generate ids like the old ones.| Constructor and Description |
|---|
LegacyTopiaIdFactory() |
| Modifier and Type | Method and Description |
|---|---|
<E extends TopiaEntity> |
getClassName(String topiaId) |
String |
getRandomPart(String topiaId) |
String |
getSeparator() |
boolean |
isTopiaId(String str) |
<E extends TopiaEntity> |
newTopiaId(Class<E> entityClass,
String randomPart)
Builds a new topiaId for the given entity type and the given random part.
|
<E extends TopiaEntity> |
newTopiaId(Class<E> entityClass,
TopiaEntity topiaEntity)
Generates a new topiaId for the given entity type and the given entity.
|
public <E extends TopiaEntity> String newTopiaId(Class<E> entityClass, TopiaEntity topiaEntity)
TopiaIdFactorynewTopiaId in interface TopiaIdFactoryE - type of entityentityClass - type of entity (must be a not null interface)topiaEntity - the entity on which we want to generate the id (must be not null)public <E extends TopiaEntity> String newTopiaId(Class<E> entityClass, String randomPart)
TopiaIdFactorynewTopiaId in interface TopiaIdFactoryE - type of entityentityClass - type of entity (must be a not null interface)randomPart - the random part of the topiaIdpublic <E extends TopiaEntity> Class<E> getClassName(String topiaId)
getClassName in interface TopiaIdFactoryE - type of the entitytopiaId - the topiaId to inspectpublic String getSeparator()
getSeparator in interface TopiaIdFactorypublic String getRandomPart(String topiaId)
getRandomPart in interface TopiaIdFactorytopiaId - the topiaId to inspectpublic boolean isTopiaId(String str)
isTopiaId in interface TopiaIdFactorystr - FIXMECopyright © 2004–2018 CodeLutin. All rights reserved.