Package de.xima.fc.workflow
Class UuidEntityRef
java.lang.Object
de.xima.fc.workflow.UuidEntityRef
- All Implemented Interfaces:
IEntityReference
,Serializable
Models a reference to another entity via the UUID of that entity. Supports JSON serialization and deserialization.
All fields of this class should not be
null
, to indicate a missing reference use null
instead of an
instance of this class.- Since:
- 7.0.0
- Author:
- XIMA MEDIA GmbH
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
static <TEntity extends IUUIDEntity>
UuidEntityRefforEntity
(TEntity entity) Creates a new entity reference for the given UUID entity.static <TEntity extends IUUIDEntity>
UuidEntityRefCreates a new entity reference with the given UUID and entity class.Class<? extends IUUIDEntity>
getUuid()
int
hashCode()
void
setEntityClass
(Class<? extends IUUIDEntity> entityClass) void
toString()
-
Constructor Details
-
UuidEntityRef
public UuidEntityRef()For JSON serialization / deserialization only. Use the static factory methods.
-
-
Method Details
-
equals
-
getEntityClass
- Specified by:
getEntityClass
in interfaceIEntityReference
- Returns:
- Type of the referenced class.
-
getUuid
- Specified by:
getUuid
in interfaceIEntityReference
- Returns:
- The UUID of the referenced entity.
-
hashCode
public int hashCode() -
setEntityClass
- Parameters:
entityClass
- Type of the referenced class.
-
setUuid
- Parameters:
uuid
- Type of the referenced class.
-
toString
-
forEntity
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
null
when 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
null
when the given UUID or entity class isnull
.
-