Class CalendarRelationMergeHandler
java.lang.Object
ch.tocco.nice2.optional.calendar.impl.merge.CalendarRelationMergeHandler
- All Implemented Interfaces:
RelationMergeHandler
if any calendars belong to the entities to be merged, copy their calendar events to the calender of the entity we are
merging to
this handler assumes that the target entity correctly only has a single calendar, otherwise it just copies them to
the first calendar
-
Constructor Summary
ConstructorDescriptionCalendarRelationMergeHandler
(CalendarEventContributionService contributionService, CommandExecutor executor, EntityDefaultValueService defaultValueService) -
Method Summary
Modifier and TypeMethodDescriptionmergeRelation
(RelationMergeContext mergeContext) Merges the relation into the target entity.int
priority()
The priority can be used to override the default handlers by using a higher priority than the default which is 0boolean
supports
(RelationModel relationModel)
-
Constructor Details
-
CalendarRelationMergeHandler
public CalendarRelationMergeHandler(CalendarEventContributionService contributionService, CommandExecutor executor, EntityDefaultValueService defaultValueService)
-
-
Method Details
-
supports
- Specified by:
supports
in interfaceRelationMergeHandler
- Returns:
- true if this handler supports merging the given relation model
-
mergeRelation
Description copied from interface:RelationMergeHandler
Merges the relation into the target entity.- Specified by:
mergeRelation
in interfaceRelationMergeHandler
- Parameters:
mergeContext
- contains the necessary data to perform the merge operation (like relation model and target entity)- Returns:
- merge result (for example skipped entities)
-
priority
public int priority()Description copied from interface:RelationMergeHandler
The priority can be used to override the default handlers by using a higher priority than the default which is 0- Specified by:
priority
in interfaceRelationMergeHandler
- Returns:
- the priority of this handler.
-