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 Details

    • CalendarEventColorServiceImpl

      public CalendarEventColorServiceImpl(QueryBuilderFactory queryBuilderFactory)
  • 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 of CalendarEventContribution and returns the first one to actually find a non-null, non-empty value
      Specified by:
      getColor in interface CalendarEventColorService
      Parameters:
      contribution - the contribution to use as fallback
      calendarEvent - the Calendar_event to find the color for, fallback is used if null
      Returns:
      the color we found in no particular format
    • getColorRelations

      public Set<String> getColorRelations()
      Specified by:
      getColorRelations in interface CalendarEventColorService
      Returns:
      a set of relations that should be checked for colors
    • setRelationsToColors

      @Autowired public void setRelationsToColors(List<CalendarEventColorContribution> relationsToColors)