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
trydofor
-
-
Method Summary
Modifier and Type Method Description abstract CdefaultConfig()get the default config abstract CcombineConfig(@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 CprovideConfig(@Nullable() String name, boolean combine)Provides different configurations depending on the name. booleansend(String subject, String content)Send synchronously with the default config, result in success or failure, or exception. booleansend(String name, String subject, String content)Send synchronously with the specified config by name, result in success or failure, or exception. abstract booleansend(C config, String subject, String content)Send synchronously with the specified config, result in success or failure, or exception. booleanpost(String subject, String content)Send synchronously with default configuration, fire and forget, no exceptions thrown. booleanpost(String name, String subject, String content)Send synchronously with the specified config by name, fire and forget, no exceptions thrown. abstract booleanpost(C config, String subject, String content)Send synchronously with the specified config, fire and forget, no exceptions thrown. voidemit(String subject, String content)Send asynchronously with default configuration, fire and forget, no exceptions thrown. voidemit(String name, String subject, String content)Send asynchronously with the specified config by name, fire and forget, no exceptions thrown. abstract voidemit(C config, String subject, String content)Send asynchronously with the specified config by name, fire and forget, no exceptions thrown. -
-
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- subjectcontent- 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=truesubject- subjectcontent- 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- configsubject- subjectcontent- 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- subjectcontent- 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=truesubject- subjectcontent- 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- subjectcontent- content- Returns:
whether success
-
emit
void emit(String subject, String content)
Send asynchronously with default configuration, fire and forget, no exceptions thrown.
- Parameters:
subject- subjectcontent- 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=truesubject- subjectcontent- content
-
-
-
-