Class DefaultInteractiveManager
-
- All Implemented Interfaces:
-
pro.fessional.wings.faceless.flywave.InteractiveManager
public final class DefaultInteractiveManager<T extends Object> implements InteractiveManager<T>
- Since:
2021-12-24
trydofor
-
-
Field Summary
Fields Modifier and Type Field Description private final AtomicReference<Pair<String, String>>lastMessage
-
Constructor Summary
Constructors Constructor Description DefaultInteractiveManager(Logger log, Map<String, DataSource> plainDataSources, String emoji)
-
Method Summary
Modifier and Type Method Description final AtomicReference<Pair<String, String>>getLastMessage()final Unitlog(Level level, String where, String info, Exception er)final Booleanask(String msg, Boolean quit)final BooleanneedAsk(T ask)BooleanneedAsk(T ask, Boolean yes)Whether to confirm before undoFunction<String, Boolean>askWay(Function<String, Boolean> func)How to confirm, pass message, return to continue or stop BiConsumer<String, String>logWay(BiConsumer<String, String> func)How to log the runtime token and message -
-
Constructor Detail
-
DefaultInteractiveManager
DefaultInteractiveManager(Logger log, Map<String, DataSource> plainDataSources, String emoji)
-
-
Method Detail
-
getLastMessage
final AtomicReference<Pair<String, String>> getLastMessage()
-
needAsk
Boolean needAsk(T ask, Boolean yes)
Whether to confirm before
undo- Parameters:
ask- ask typeyes- whether to confirm, true by default- Returns:
old value
-
askWay
Function<String, Boolean> askWay(Function<String, Boolean> func)
How to confirm, pass message, return to continue or stop
-
logWay
BiConsumer<String, String> logWay(BiConsumer<String, String> func)
How to log the runtime token and message
-
-
-
-