it.tidalwave.role
Interface IdFactory

Package class diagram package IdFactory

public interface IdFactory

A factory for creating new, unique Id for an object.

Version:
$Id$
Author:
Fabrizio Giudici
Status: stable API

Field Summary
static Class<IdFactory> IdFactory
           
 
Method Summary
 Id createId()
          Creates a new id.
 Id createId(Class<?> objectClass)
          Created a new id for an object of the given class.
 Id createId(Class<?> objectClass, Object object)
          Created a new id for the given object of the given class.
 

Field Detail

IdFactory

static final Class<IdFactory> IdFactory
Method Detail

createId

@Nonnull
Id createId()
Creates a new id.

Returns:
the new id

createId

@Nonnull
Id createId(@Nonnull
                    Class<?> objectClass)
Created a new id for an object of the given class.

Parameters:
objectClass - the class of the object for which the Id is created
Returns:
the new id

createId

@Nonnull
Id createId(@Nonnull
                    Class<?> objectClass,
                    @Nonnull
                    Object object)
Created a new id for the given object of the given class. This method allows to explicitly pass a Class for cases in which the object implements multiple interfaces and one wants to specify the referenced one.

Parameters:
object - the object for which the Id
objectClass - the class of the object for which the Id is created
Returns:
the new id


Copyright © 2009-2012 Tidalwave s.a.s.. All Rights Reserved.