Package de.xima.fc.workflow
Class UuidEntityRef
- java.lang.Object
-
- de.xima.fc.workflow.UuidEntityRef
-
- All Implemented Interfaces:
IEntityReference,Serializable
public final class UuidEntityRef extends Object implements IEntityReference
Models a reference to another entity via the UUID of that entity. Supports JSON serialization and deserialization. All fields of this class should not benull, to indicate a missing reference usenullinstead of an instance of this class.- Since:
- 7.0.0
- Author:
- XIMA MEDIA GmbH
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description UuidEntityRef()For JSON serialization / deserialization only.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)static <TEntity extends IUUIDEntity>
UuidEntityRefforEntity(TEntity entity)Creates a new entity reference for the given UUID entity.static <TEntity extends IUUIDEntity>
UuidEntityRefforUuid(UUID uuid, Class<TEntity> entityClass)Creates a new entity reference with the given UUID and entity class.Class<? extends IUUIDEntity>getEntityClass()UUIDgetUuid()inthashCode()voidsetEntityClass(Class<? extends IUUIDEntity> entityClass)voidsetUuid(UUID uuid)StringtoString()
-
-
-
Method Detail
-
getEntityClass
public Class<? extends IUUIDEntity> getEntityClass()
- Specified by:
getEntityClassin interfaceIEntityReference- Returns:
- Type of the referenced class.
-
getUuid
public UUID getUuid()
- Specified by:
getUuidin interfaceIEntityReference- Returns:
- The UUID of the referenced entity.
-
setEntityClass
public void setEntityClass(Class<? extends IUUIDEntity> entityClass)
- Parameters:
entityClass- Type of the referenced class.
-
setUuid
public void setUuid(UUID uuid)
- Parameters:
uuid- Type of the referenced class.
-
forEntity
public static <TEntity extends IUUIDEntity> UuidEntityRef forEntity(TEntity entity)
Creates a new entity reference for the given UUID entity.- Type Parameters:
TEntity- Type of the referenced entity.- Parameters:
entity- An entity for which to create a reference.- Returns:
- A new instance with the given UUID and class, or
nullwhen the given entity isnull.
-
forUuid
public static <TEntity extends IUUIDEntity> UuidEntityRef forUuid(UUID uuid, Class<TEntity> entityClass)
Creates a new entity reference with the given UUID and entity class.- Type Parameters:
TEntity- Type of the referenced entity.- Parameters:
uuid- UUID of the referenced entity.entityClass- Type of the referenced entity.- Returns:
- A new instance with the given UUID and class, or
nullwhen the given UUID or entity class isnull.
-
-