模块 linlang.api

接口 LinMessenger


public interface LinMessenger
Linlang 的一次性文本消息投递服务。

普通聊天、动作栏和标题消息均可通过便捷方法在一条语句内发送。 需要覆盖默认投递策略时,可以创建 LinMessage 后交给 send(Object, LinMessage)。

  • 方法详细资料

    • send

      void send(Object recipient, LinMessage message)
      投递完整消息定义。

      无法规范化、选择传输器或完成投递时,运行时通过 Problem 系统记录故障, 不再把传输层异常传播到业务调用栈。

      参数:
      recipient - 接收者
      message - 消息定义
    • registerTransport

      LinMessenger registerTransport(MessageTransport transport)
      注册消息传输层。

      相同标识的传输层应替换旧实现。该入口主要供运行时扩展与未来网络模块使用。

      参数:
      transport - 消息传输层
      返回:
      当前消息服务
    • unregisterTransport

      boolean unregisterTransport(String id)
      移除指定消息传输层。
      参数:
      id - 传输层标识
      返回:
      找到并移除时为 true
    • send

      default void send(Object recipient, String text, Object... args)
      发送聊天高级字符串。
      参数:
      recipient - 接收者
      text - 高级字符串源码
      args - 名称和值交替排列的变量
    • send

      default void send(Object recipient, TextSource text, Object... args)
      发送聊天文本来源。
      参数:
      recipient - 接收者
      text - 文本来源
      args - 名称和值交替排列的变量
    • send

      default void send(Object recipient, String text, Map<String,?> args)
      使用变量映射发送聊天高级字符串。
      参数:
      recipient - 接收者
      text - 高级字符串源码
      args - 变量映射
    • send

      default void send(Object recipient, TextSource text, Map<String,?> args)
      使用变量映射发送聊天文本来源。
      参数:
      recipient - 接收者
      text - 文本来源
      args - 变量映射
    • actionBar

      default void actionBar(Object recipient, String text, Object... args)
      发送动作栏高级字符串。
      参数:
      recipient - 接收者
      text - 高级字符串源码
      args - 名称和值交替排列的变量
    • actionBar

      default void actionBar(Object recipient, TextSource text, Object... args)
      发送动作栏文本来源。
      参数:
      recipient - 接收者
      text - 文本来源
      args - 名称和值交替排列的变量
    • actionBar

      default void actionBar(Object recipient, String text, Map<String,?> args)
      使用变量映射发送动作栏高级字符串。
      参数:
      recipient - 接收者
      text - 高级字符串源码
      args - 变量映射
    • actionBar

      default void actionBar(Object recipient, TextSource text, Map<String,?> args)
      使用变量映射发送动作栏文本来源。
      参数:
      recipient - 接收者
      text - 文本来源
      args - 变量映射
    • title

      default void title(Object recipient, String title, String subtitle, Object... args)
      使用默认时长发送标题高级字符串。
      参数:
      recipient - 接收者
      title - 主标题高级字符串源码
      subtitle - 副标题高级字符串源码
      args - 名称和值交替排列的变量
    • title

      default void title(Object recipient, TextSource title, TextSource subtitle, Object... args)
      使用默认时长发送标题文本来源。
      参数:
      recipient - 接收者
      title - 主标题来源
      subtitle - 副标题来源
      args - 名称和值交替排列的变量
    • title

      default void title(Object recipient, String title, String subtitle, TitleTimes times, Object... args)
      使用指定时长发送标题高级字符串。
      参数:
      recipient - 接收者
      title - 主标题高级字符串源码
      subtitle - 副标题高级字符串源码
      times - 标题时长
      args - 名称和值交替排列的变量
    • title

      default void title(Object recipient, TextSource title, TextSource subtitle, TitleTimes times, Object... args)
      使用指定时长发送标题文本来源。
      参数:
      recipient - 接收者
      title - 主标题来源
      subtitle - 副标题来源
      times - 标题时长
      args - 名称和值交替排列的变量