Interface SmallNotice

  • All Implemented Interfaces:

    
    public interface SmallNotice<C>
    
                        

    Small and short messages, thread-safe. encryption is required if the Conf contains any personal information, such as @AesString.

    Since:

    2022-09-29

    Author:

    trydofor

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract C defaultConfig() get the default config
      abstract C combineConfig(@Nullable() C that) Build a new configuration with the `that` value as priority, and use the default configuration if the `that` item is invalid.
      abstract C provideConfig(@Nullable() String name, boolean combine) Provides different configurations depending on the name.
      boolean send(String subject, String content) Send synchronously with the default config, result in success or failure, or exception.
      boolean send(String name, String subject, String content) Send synchronously with the specified config by name, result in success or failure, or exception.
      abstract boolean send(C config, String subject, String content) Send synchronously with the specified config, result in success or failure, or exception.
      boolean post(String subject, String content) Send synchronously with default configuration, fire and forget, no exceptions thrown.
      boolean post(String name, String subject, String content) Send synchronously with the specified config by name, fire and forget, no exceptions thrown.
      abstract boolean post(C config, String subject, String content) Send synchronously with the specified config, fire and forget, no exceptions thrown.
      void emit(String subject, String content) Send asynchronously with default configuration, fire and forget, no exceptions thrown.
      void emit(String name, String subject, String content) Send asynchronously with the specified config by name, fire and forget, no exceptions thrown.
      abstract void emit(C config, String subject, String content) Send asynchronously with the specified config by name, fire and forget, no exceptions thrown.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • defaultConfig

        @NotNull() abstract C defaultConfig()

        get the default config

      • combineConfig

        @Contract(value = "_->new") abstract C combineConfig(@Nullable() C that)

        Build a new configuration with the `that` value as priority, and use the default configuration if the `that` item is invalid.

      • provideConfig

        @Contract(value = "_,true->new") abstract C provideConfig(@Nullable() String name, boolean combine)

        Provides different configurations depending on the name. combine with default when `combine`. conf == null ? defaultConfig() : combineConfig(conf)

      • send

         boolean send(String subject, String content)

        Send synchronously with the default config, result in success or failure, or exception. return false if both subject and content are null

        Parameters:
        subject - subject
        content - content
        Returns:

        whether success

      • send

         boolean send(String name, String subject, String content)

        Send synchronously with the specified config by name, result in success or failure, or exception. return false if both subject and content are null

        Parameters:
        name - config's name, with combine=true
        subject - subject
        content - content
        Returns:

        whether success

      • send

         abstract boolean send(C config, String subject, String content)

        Send synchronously with the specified config, result in success or failure, or exception. return false if both subject and content are null

        Parameters:
        config - config
        subject - subject
        content - content
        Returns:

        whether success

      • post

         boolean post(String subject, String content)

        Send synchronously with default configuration, fire and forget, no exceptions thrown. return false if both subject and content are null

        Parameters:
        subject - subject
        content - content
        Returns:

        whether success

      • post

         boolean post(String name, String subject, String content)

        Send synchronously with the specified config by name, fire and forget, no exceptions thrown. return false if both subject and content are null

        Parameters:
        name - config's name, with combine=true
        subject - subject
        content - content
        Returns:

        whether success

      • post

         abstract boolean post(C config, String subject, String content)

        Send synchronously with the specified config, fire and forget, no exceptions thrown. return false if both subject and content are null

        Parameters:
        config - config, invalid item can be overridden by the default.
        subject - subject
        content - content
        Returns:

        whether success

      • emit

         void emit(String subject, String content)

        Send asynchronously with default configuration, fire and forget, no exceptions thrown.

        Parameters:
        subject - subject
        content - content
      • emit

         void emit(String name, String subject, String content)

        Send asynchronously with the specified config by name, fire and forget, no exceptions thrown.

        Parameters:
        name - config's name, with combine=true
        subject - subject
        content - content
      • emit

         abstract void emit(C config, String subject, String content)

        Send asynchronously with the specified config by name, fire and forget, no exceptions thrown.

        Parameters:
        config - config, invalid item can be overridden by the default.
        subject - subject
        content - content