Class DeletionReason
java.lang.Object
de.xima.fc.mdl.DeletionReason
- All Implemented Interfaces:
Serializable
Model representing a reason for the deletion of one or more entities. The model is mainly used for transmission in
order to generate the log entry correctly during deletion.
- Since:
- 8.0.1
- Author:
- XIMA MEDIA GmbH
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDeletionReason(Map<String, String> reasonMap) Creates a new reason map with a user defined mapping. -
Method Summary
Modifier and TypeMethodDescriptionstatic DeletionReasoncombine(DeletionReason... reasons) Creates a new deletion reason with the combined reasons map from the given reasons.static DeletionReasonempty()Returns an empty deletion reason with an empty reasons map.extend(DeletionReason... other) Creates a new deletion reason with the combined reasons map from this and the other reason.static DeletionReasonforEntities(String deletionReason, String entityName, List<Long> idList) This method creates a newDeletionReasonobject with the given reason text and the combination of entity name and the list of id of the deleted entities.static DeletionReasonThis method creates a newDeletionReasoninstance with the given reason text and the combination of entity name and the id of the entity.static DeletionReasonforEntityType(String deletionReason, Class<? extends de.xima.cmn.dao.interfaces.IEntity<?>> entity) This method creates a newDeletionReasonobject with the given reason text and the combination of entity name and the id of the entity.getReasonByEntity(Class<? extends de.xima.cmn.dao.interfaces.IEntity<?>> entity, long id) Gets the reason for a specific entity.getReasonByEntityType(Class<? extends de.xima.cmn.dao.interfaces.IEntity<?>> entity) Gets the reason for a specific type of entity.
-
Constructor Details
-
DeletionReason
-
-
Method Details
-
getReasonMap
-
getReasonByEntity
public String getReasonByEntity(Class<? extends de.xima.cmn.dao.interfaces.IEntity<?>> entity, long id) Gets the reason for a specific entity.- Parameters:
entity- Type of the entity.id- ID of the entity.- Returns:
- The reason for the given entity with a certain ID, or empty if no such reason exists.
-
getReasonByEntityType
-
forEntityType
public static DeletionReason forEntityType(String deletionReason, Class<? extends de.xima.cmn.dao.interfaces.IEntity<?>> entity) This method creates a newDeletionReasonobject with the given reason text and the combination of entity name and the id of the entity.- Parameters:
deletionReason- reason text which is displayed in protocolentity- Type of the entity- Returns:
- object with the given parameters
-
forEntity
public static DeletionReason forEntity(String deletionReason, de.xima.cmn.dao.interfaces.IEntity<?> entity) This method creates a newDeletionReasoninstance with the given reason text and the combination of entity name and the id of the entity.- Parameters:
deletionReason- reason text which is displayed in protocolentity- Entity that was deleted.- Returns:
- object with the given parameters
-
forEntities
public static DeletionReason forEntities(String deletionReason, String entityName, List<Long> idList) This method creates a newDeletionReasonobject with the given reason text and the combination of entity name and the list of id of the deleted entities.- Parameters:
deletionReason- reason text which is displayed in protocolentityName- class name of the entityidList- list of IDs of the entities- Returns:
- object with the given parameters
-
extend
Creates a new deletion reason with the combined reasons map from this and the other reason.- Parameters:
other- The other reason to combine with.- Returns:
- A new deletion reason with the combined reasons.
-
combine
Creates a new deletion reason with the combined reasons map from the given reasons.- Parameters:
reasons- Reasons to combine.- Returns:
- A new deletion reason with the combined reasons.
-
empty
Returns an empty deletion reason with an empty reasons map.- Returns:
- An empty deletion reason.
-