/** * Returns all channel types with the default {@link Locale}. * * @return all channel types or empty list if no channel type exists */ public List<ChannelType> getChannelTypes() { return getChannelTypes(null); }
@GET @Produces(MediaType.APPLICATION_JSON) @ApiOperation(value = "Gets all available channel types.", response = ChannelTypeDTO.class, responseContainer = "Set") @ApiResponses(value = @ApiResponse(code = 200, message = "OK", response = ChannelTypeDTO.class, responseContainer = "Set")) public Response getAll( @HeaderParam(HttpHeaders.ACCEPT_LANGUAGE) @ApiParam(value = HttpHeaders.ACCEPT_LANGUAGE) String language) { Locale locale = localeService.getLocale(language); Stream<ChannelTypeDTO> channelStream = channelTypeRegistry.getChannelTypes(locale).stream() .map(c -> convertToChannelTypeDTO(c, locale)); return Response.ok(new Stream2JSONInputStream(channelStream)).build(); }