Class CalendarEventColorServiceImpl
java.lang.Object
ch.tocco.nice2.optional.calendar.impl.rest.services.CalendarEventColorServiceImpl
- All Implemented Interfaces:
CalendarEventColorService
@Component
public class CalendarEventColorServiceImpl
extends Object
implements CalendarEventColorService
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetColor
(CalendarEventContribution contribution, @Nullable Entity calendarEvent) find the color to use for a given Calendar_event entity typically used in conjunction with the scheduler it is recommended to configure hex values as colors, but there isn't any validator yet to ensure correct values to find a color, this service steps through the list ofCalendarEventContribution
and returns the first one to actually find a non-null, non-empty valuevoid
setRelationsToColors
(List<CalendarEventColorContribution> relationsToColors)
-
Constructor Details
-
CalendarEventColorServiceImpl
-
-
Method Details
-
getColor
public String getColor(CalendarEventContribution contribution, @Nullable @Nullable Entity calendarEvent) Description copied from interface:CalendarEventColorService
find the color to use for a given Calendar_event entity typically used in conjunction with the scheduler it is recommended to configure hex values as colors, but there isn't any validator yet to ensure correct values to find a color, this service steps through the list ofCalendarEventContribution
and returns the first one to actually find a non-null, non-empty value- Specified by:
getColor
in interfaceCalendarEventColorService
- Parameters:
contribution
- the contribution to use as fallbackcalendarEvent
- the Calendar_event to find the color for, fallback is used if null- Returns:
- the color we found in no particular format
-
getColorRelations
- Specified by:
getColorRelations
in interfaceCalendarEventColorService
- Returns:
- a set of relations that should be checked for colors
-
setRelationsToColors
-