Package de.xima.fc.mdl
Class DeletionReason
- java.lang.Object
-
- de.xima.fc.mdl.DeletionReason
-
- All Implemented Interfaces:
Serializable
public class DeletionReason extends Object implements 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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DeletionReason(Map<String,String> reasonMap)
Creates a new reason map with a user defined mapping.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DeletionReason
forEntities(String deletionReason, String entityName, List<Long> idList)
This method creates a newDeletionReason
object with the given reason text and the combination of entity name and the list of id of the deleted entities.static DeletionReason
forEntity(String deletionReason, de.xima.cmn.dao.interfaces.IEntity<?> entity)
This method creates a newDeletionReason
instance with the given reason text and the combination of entity name and the id of the entity.static DeletionReason
forEntityType(String deletionReason, Class<? extends de.xima.cmn.dao.interfaces.IEntity<?>> entity)
This method creates a newDeletionReason
object with the given reason text and the combination of entity name and the id of the entity.String
getReasonByEntity(Class<? extends de.xima.cmn.dao.interfaces.IEntity<?>> entity, long id)
Gets the reason for a specific entity.String
getReasonByEntityType(Class<? extends de.xima.cmn.dao.interfaces.IEntity<?>> entity)
Gets the reason for a specific type of entity.Map<String,String>
getReasonMap()
-
-
-
Method Detail
-
getReasonMap
public Map<String,String> getReasonMap()
- Returns:
- Mapping between the deletion type (such as the entity name) and the reason for the deletion. The returned map cannot be modified.
-
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
public String getReasonByEntityType(Class<? extends de.xima.cmn.dao.interfaces.IEntity<?>> entity)
Gets the reason for a specific type of entity.- Parameters:
entity
- Type of the entity.- Returns:
- The reason for the given entity type, or empty if no such reason exists.
-
forEntityType
public static DeletionReason forEntityType(String deletionReason, Class<? extends de.xima.cmn.dao.interfaces.IEntity<?>> entity)
This method creates a newDeletionReason
object 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 newDeletionReason
instance 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 newDeletionReason
object 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
-
-