Move factory interface to public package (#3742)

Signed-off-by: Jan N. Klug <github@klug.nrw>
This commit is contained in:
J-N-K 2023-08-11 17:47:44 +02:00 committed by GitHub
parent 17e9cf3850
commit 409198cd8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 7 deletions

View File

@ -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<State> updateState, Consumer<Command> postCommand,
@Nullable Consumer<String> sendHttpValue, ChannelTransformation stateTransformations,
ChannelTransformation commandTransformations, ChannelValueConverterConfig channelConfig);
}
}

View File

@ -105,11 +105,4 @@ public abstract class AbstractTransformingChannelHandler implements ChannelHandl
* @return the string representation of the command
*/
protected abstract String toString(Command command);
@FunctionalInterface
public interface Factory {
ChannelHandler create(Consumer<State> updateState, Consumer<Command> postCommand,
@Nullable Consumer<String> sendHttpValue, ChannelTransformation stateTransformations,
ChannelTransformation commandTransformations, ChannelValueConverterConfig channelConfig);
}
}