From ab135421a0642a6fbd5b4f444e0ca4bdd67f14bc Mon Sep 17 00:00:00 2001 From: Holger Friedrich Date: Thu, 24 Aug 2023 06:46:18 +0200 Subject: [PATCH] [voice] Make use of Java17 features (#15487) Use Map/Set/List.of instead of Collections. Signed-off-by: Holger Friedrich --- .../org/openhab/voice/picotts/internal/PicoTTSService.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bundles/org.openhab.voice.picotts/src/main/java/org/openhab/voice/picotts/internal/PicoTTSService.java b/bundles/org.openhab.voice.picotts/src/main/java/org/openhab/voice/picotts/internal/PicoTTSService.java index ecb6a2ebb..93d149c64 100644 --- a/bundles/org.openhab.voice.picotts/src/main/java/org/openhab/voice/picotts/internal/PicoTTSService.java +++ b/bundles/org.openhab.voice.picotts/src/main/java/org/openhab/voice/picotts/internal/PicoTTSService.java @@ -12,7 +12,6 @@ */ package org.openhab.voice.picotts.internal; -import java.util.Collections; import java.util.Locale; import java.util.Set; import java.util.stream.Collectors; @@ -49,8 +48,8 @@ public class PicoTTSService extends AbstractCachedTTSService { new PicoTTSVoice("es-ES"), new PicoTTSVoice("fr-FR"), new PicoTTSVoice("it-IT")) .collect(Collectors.toSet()); - private final Set audioFormats = Collections.singleton( - new AudioFormat(AudioFormat.CONTAINER_WAVE, AudioFormat.CODEC_PCM_SIGNED, false, 16, null, 16000L)); + private final Set audioFormats = Set + .of(new AudioFormat(AudioFormat.CONTAINER_WAVE, AudioFormat.CODEC_PCM_SIGNED, false, 16, null, 16000L)); @Override public Set getAvailableVoices() {