Package org.nuclos.api.context
Class MessageContext.WithArgs
java.lang.Object
org.nuclos.api.context.MessageContext.WithArgs
- Enclosing class:
- MessageContext
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
sendMessage
(boolean translateAndRememberWithGeneratedKey, String message) Sends a message to the client with the configured arguments.void
sendMessage
(boolean translateAndRememberWithGeneratedKey, String message, String title) Sends a message with a title to the client with the configured arguments.void
sendMessage
(boolean translateAndRememberWithGeneratedKey, String message, String title, Locale sourceLocale) Sends a message with a title to the client with translation option for a specific locale and the configured arguments.void
sendMessage
(boolean translateAndRememberWithGeneratedKey, String message, Locale sourceLocale) Sends a message to the client with translation option for a specific locale and the configured arguments.void
sendMessage
(boolean translateAndRememberWithGeneratedKey, String message, NuclosLocale sourceLocale) Sends a message to the client with translation option for a specific Nuclos locale and the configured arguments.void
sendMessage
(String message) Sends a message to the client with the configured arguments.void
sendMessage
(String message, String title) Sends a message with a title to the client with the configured arguments.void
sendMessage
(String key, String message, String title) Sends a message with a title to the client using a specific localization key and the configured arguments.void
sendMessage
(String key, String message, String title, Locale sourceLocale) Sends a message with a title to the client using a specific localization key, locale and the configured arguments.void
sendMessage
(String key, String message, String title, NuclosLocale sourceLocale) Sends a message with a title to the client using a specific localization key, Nuclos locale and the configured arguments.void
sendMessage
(DoNotTranslate message) Sends a message to the client without translation but with the configured arguments.void
sendMessage
(DoNotTranslate message, DoNotTranslate title) Sends a message with a title to the client without translation but with the configured arguments.void
sendMessageDoNotTranslate
(String message) Sends a message to the client without translation but with the configured arguments.void
sendMessageDoNotTranslate
(String message, String title) Sends a message with a title to the client without translation but with the configured arguments.void
sendProgress
(int percent, boolean translateAndRememberWithGeneratedKey, String message, Locale sourceLocale) Sends a progress update to the client with translation options, a specific locale and the configured arguments.void
sendProgress
(int percent, boolean translateAndRememberWithGeneratedKey, String message, NuclosLocale sourceLocale) Sends a progress update to the client with translation options, a specific Nuclos locale and the configured arguments.void
sendProgress
(int percent, String message) Sends a progress update to the client with the configured arguments.void
sendProgress
(int percent, String key, String message, Locale sourceLocale) Sends a progress update to the client using a specific localization key, locale and the configured arguments.void
sendProgress
(int percent, String key, String message, NuclosLocale sourceLocale) Sends a progress update to the client using a specific localization key, Nuclos locale and the configured arguments.void
sendProgress
(int percent, DoNotTranslate message) Sends a progress update to the client without translation but with the configured arguments.void
sendProgressDoNotTranslate
(int percent, String message) Sends a progress update to the client without translation but with the configured arguments.withMessageArgs
(Object... messageArgs) Sets message arguments for formatting the message string.withTitleArgs
(Object... titleArgs) Sets title arguments for formatting the title string.
-
Constructor Details
-
WithArgs
public WithArgs()Creates a new WithArgs instance.
-
-
Method Details
-
withMessageArgs
Sets message arguments for formatting the message string.- Parameters:
messageArgs
- The arguments to use for message formatting- Returns:
- This WithArgs instance for method chaining
-
withTitleArgs
Sets title arguments for formatting the title string.- Parameters:
titleArgs
- The arguments to use for title formatting- Returns:
- This WithArgs instance for method chaining
-
sendMessage
Sends a message to the client with the configured arguments.- Parameters:
message
- The message text to send
-
sendMessage
Sends a message to the client with the configured arguments.- Parameters:
translateAndRememberWithGeneratedKey
- If true, translate and remember with a generated keymessage
- The message text to send
-
sendMessage
public void sendMessage(boolean translateAndRememberWithGeneratedKey, String message, Locale sourceLocale) Sends a message to the client with translation option for a specific locale and the configured arguments.- Parameters:
translateAndRememberWithGeneratedKey
- If true, translate and remember with a generated keymessage
- The message text to sendsourceLocale
- The locale of the text
-
sendMessage
public void sendMessage(boolean translateAndRememberWithGeneratedKey, String message, NuclosLocale sourceLocale) Sends a message to the client with translation option for a specific Nuclos locale and the configured arguments.- Parameters:
translateAndRememberWithGeneratedKey
- If true, translate and remember with a generated keymessage
- The message text to sendsourceLocale
- The NuclosLocale of the text
-
sendMessageDoNotTranslate
Sends a message to the client without translation but with the configured arguments.- Parameters:
message
- The message text to send without translation
-
sendMessage
Sends a message to the client without translation but with the configured arguments.- Parameters:
message
- The message to send without translation
-
sendMessage
Sends a message with a title to the client with the configured arguments.- Parameters:
message
- The message text to sendtitle
- The title for the message
-
sendMessage
Sends a message with a title to the client with the configured arguments.- Parameters:
translateAndRememberWithGeneratedKey
- If true, translate and remember with a generated keymessage
- The message text to sendtitle
- The title for the message
-
sendMessage
public void sendMessage(boolean translateAndRememberWithGeneratedKey, String message, String title, Locale sourceLocale) Sends a message with a title to the client with translation option for a specific locale and the configured arguments.- Parameters:
translateAndRememberWithGeneratedKey
- If true, translate and remember with a generated keymessage
- The message text to sendtitle
- The title for the messagesourceLocale
- The locale of the text
-
sendMessageDoNotTranslate
Sends a message with a title to the client without translation but with the configured arguments.- Parameters:
message
- The message text to send without translationtitle
- The title for the message without translation
-
sendMessage
Sends a message with a title to the client without translation but with the configured arguments.- Parameters:
message
- The message to send without translationtitle
- The title for the message without translation
-
sendMessage
Sends a message with a title to the client using a specific localization key and the configured arguments.- Parameters:
key
- The localization key to usemessage
- The message text to sendtitle
- The title for the message
-
sendMessage
Sends a message with a title to the client using a specific localization key, locale and the configured arguments.- Parameters:
key
- The localization key to usemessage
- The message text to sendtitle
- The title for the messagesourceLocale
- The locale of the text
-
sendMessage
Sends a message with a title to the client using a specific localization key, Nuclos locale and the configured arguments.- Parameters:
key
- The localization key to usemessage
- The message text to sendtitle
- The title for the messagesourceLocale
- The NuclosLocale of the text
-
sendProgress
Sends a progress update to the client with the configured arguments.- Parameters:
percent
- The progress percentage (0-100)message
- The progress message text
-
sendProgressDoNotTranslate
Sends a progress update to the client without translation but with the configured arguments.- Parameters:
percent
- The progress percentage (0-100)message
- The progress message text without translation
-
sendProgress
Sends a progress update to the client without translation but with the configured arguments.- Parameters:
percent
- The progress percentage (0-100)message
- The progress message without translation
-
sendProgress
public void sendProgress(int percent, boolean translateAndRememberWithGeneratedKey, String message, Locale sourceLocale) Sends a progress update to the client with translation options, a specific locale and the configured arguments.- Parameters:
percent
- The progress percentage (0-100)translateAndRememberWithGeneratedKey
- If true, translate and remember with a generated keymessage
- The progress message textsourceLocale
- The locale of the text
-
sendProgress
public void sendProgress(int percent, boolean translateAndRememberWithGeneratedKey, String message, NuclosLocale sourceLocale) Sends a progress update to the client with translation options, a specific Nuclos locale and the configured arguments.- Parameters:
percent
- The progress percentage (0-100)translateAndRememberWithGeneratedKey
- If true, translate and remember with a generated keymessage
- The progress message textsourceLocale
- The NuclosLocale of the text
-
sendProgress
Sends a progress update to the client using a specific localization key, locale and the configured arguments.- Parameters:
percent
- The progress percentage (0-100)key
- The localization key to usemessage
- The progress message textsourceLocale
- The locale of the text
-
sendProgress
Sends a progress update to the client using a specific localization key, Nuclos locale and the configured arguments.- Parameters:
percent
- The progress percentage (0-100)key
- The localization key to usemessage
- The progress message textsourceLocale
- The NuclosLocale of the text
-