Package it.tidalwave.role
Interface IdFactory
-
public interface IdFactoryA factory for creating a new, uniqueIdfor an object.- Author:
- Fabrizio Giudici
- Status: stable API
- Stereotype:
- Role
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.Class<IdFactory>_IdFactory_
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description IdcreateId()Creates a new id.IdcreateId(java.lang.Class<?> objectClass)Creates a new id for an object of the given class.IdcreateId(java.lang.Class<?> objectClass, java.lang.Object object)Creates a new id for the given object of the given class.
-
-
-
Field Detail
-
_IdFactory_
static final java.lang.Class<IdFactory> _IdFactory_
-
-
Method Detail
-
createId
@Nonnull Id createId()
Creates a new id.- Returns:
- the new id
-
createId
@Nonnull Id createId(@Nonnull java.lang.Class<?> objectClass)
Creates a new id for an object of the given class.- Parameters:
objectClass- the class of the object for which theIdis created- Returns:
- the new id
-
createId
@Nonnull Id createId(@Nonnull java.lang.Class<?> objectClass, @Nonnull java.lang.Object object)
Creates a new id for the given object of the given class. This method allows to explicitly pass aClassfor cases in which theobjectimplements multiple interfaces and one wants to specify the referenced one.- Parameters:
object- the object for which theIdobjectClass- the class of the object for which theIdis created- Returns:
- the new id
-
-