From 0edc5534562dec492a95451e6720746ba4b281d2 Mon Sep 17 00:00:00 2001 From: "Jan N. Klug" Date: Sat, 5 Aug 2023 16:36:02 +0200 Subject: [PATCH] Move factory interface to public package Signed-off-by: Jan N. Klug --- .../core/thing/binding/generic/ChannelHandler.java | 10 ++++++++++ .../converter/AbstractTransformingChannelHandler.java | 7 ------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/bundles/org.openhab.core.thing/src/main/java/org/openhab/core/thing/binding/generic/ChannelHandler.java b/bundles/org.openhab.core.thing/src/main/java/org/openhab/core/thing/binding/generic/ChannelHandler.java index 8839167d4f9..eda80471861 100644 --- a/bundles/org.openhab.core.thing/src/main/java/org/openhab/core/thing/binding/generic/ChannelHandler.java +++ b/bundles/org.openhab.core.thing/src/main/java/org/openhab/core/thing/binding/generic/ChannelHandler.java @@ -12,9 +12,12 @@ */ package org.openhab.core.thing.binding.generic; +import java.util.function.Consumer; + import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; import org.openhab.core.types.Command; +import org.openhab.core.types.State; /** * The {@link ChannelHandler} defines the interface for converting received {@link ChannelHandlerContent} @@ -40,4 +43,11 @@ public interface ChannelHandler { * @param command */ void send(Command command); + + @FunctionalInterface + public interface Factory { + ChannelHandler create(Consumer updateState, Consumer postCommand, + @Nullable Consumer sendHttpValue, ChannelTransformation stateTransformations, + ChannelTransformation commandTransformations, ChannelValueConverterConfig channelConfig); + } } diff --git a/bundles/org.openhab.core.thing/src/main/java/org/openhab/core/thing/internal/binding/generic/converter/AbstractTransformingChannelHandler.java b/bundles/org.openhab.core.thing/src/main/java/org/openhab/core/thing/internal/binding/generic/converter/AbstractTransformingChannelHandler.java index b4e332f0c9a..0850dccb31d 100644 --- a/bundles/org.openhab.core.thing/src/main/java/org/openhab/core/thing/internal/binding/generic/converter/AbstractTransformingChannelHandler.java +++ b/bundles/org.openhab.core.thing/src/main/java/org/openhab/core/thing/internal/binding/generic/converter/AbstractTransformingChannelHandler.java @@ -105,11 +105,4 @@ public void send(Command command) { * @return the string representation of the command */ protected abstract String toString(Command command); - - @FunctionalInterface - public interface Factory { - ChannelHandler create(Consumer updateState, Consumer postCommand, - @Nullable Consumer sendHttpValue, ChannelTransformation stateTransformations, - ChannelTransformation commandTransformations, ChannelValueConverterConfig channelConfig); - } }