class EnrichedThingDTOMapper extends ThingDTOMapper {

    public static EnrichedThingDTO map(Thing thing, ThingStatusInfo thingStatusInfo, FirmwareStatusDTO firmwareStatus,
            Map<String, Set<String>> linkedItemsMap, boolean editable) {
        ThingDTO thingDTO = ThingDTOMapper.map(thing);

        List<ChannelDTO> channels = new ArrayList<>();
        for (ChannelDTO channel : thingDTO.channels) {
            Set<String> linkedItems = linkedItemsMap != null ? linkedItemsMap.get(channel.id) : Collections.emptySet();
            channels.add(new EnrichedChannelDTO(channel, linkedItems));
        }

        return new EnrichedThingDTO(thingDTO, channels, thingStatusInfo, firmwareStatus, editable);
    }

}