Skip to content

Commit

Permalink
Move factory interface to public package
Browse files Browse the repository at this point in the history
Signed-off-by: Jan N. Klug <[email protected]>
  • Loading branch information
J-N-K committed Aug 5, 2023
1 parent 3b91692 commit 0edc553
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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<State> updateState, Consumer<Command> postCommand,
@Nullable Consumer<String> sendHttpValue, ChannelTransformation stateTransformations,
ChannelTransformation commandTransformations, ChannelValueConverterConfig channelConfig);
}
}

0 comments on commit 0edc553

Please sign in to comment.