class ChannelTypeResource implements RESTResource {

    @GET
    @Produces(MediaType.APPLICATION_JSON)
    @Operation(summary = "Gets all available channel types.", responses = {
            @ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = ChannelTypeDTO.class), uniqueItems = true))) })
    public Response getAll(
            @HeaderParam(HttpHeaders.ACCEPT_LANGUAGE) @Parameter(description = "language") @Nullable String language,
            @QueryParam("prefixes") @Parameter(description = "filter UIDs by prefix (multiple comma-separated prefixes allowed, for example: 'system,mqtt')") @Nullable String prefixes) {
        Locale locale = localeService.getLocale(language);

        Stream<ChannelTypeDTO> channelStream = channelTypeRegistry.getChannelTypes(locale).stream()
                .map(c -> convertToChannelTypeDTO(c, locale));

        if (prefixes != null) {
            Predicate<ChannelTypeDTO> filter = ct -> false;
            for (String prefix : prefixes.split(",")) {
                filter = filter.or(ct -> ct.UID.startsWith(prefix + ":"));
            }
            channelStream = channelStream.filter(filter);
        }

        return Response.ok(new Stream2JSONInputStream(channelStream)).build();
    }

    @Activate public  ChannelTypeResource( //
            final @Reference ChannelTypeRegistry channelTypeRegistry,
            final @Reference ConfigDescriptionRegistry configDescriptionRegistry,
            final @Reference LocaleService localeService, //
            final @Reference ProfileTypeRegistry profileTypeRegistry);

}