Package com.atlassian.bamboo.util
Class TextProviderUtils
- java.lang.Object
-
- com.atlassian.bamboo.util.TextProviderUtils
-
public final class TextProviderUtils extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringgetHtml(com.atlassian.sal.api.message.I18nResolver i18nResolver, String msg, String... params)static StringgetHtml(com.opensymphony.xwork2.TextProvider textProvider, String msg, String... params)static StringgetText(com.atlassian.sal.api.message.I18nResolver i18nResolver, String msg, String... params)static StringgetText(com.opensymphony.xwork2.TextProvider textProvider, String msg, String... params)static StringgetText(String i18nKey)static com.opensymphony.xwork2.TextProvidergetTextProvider()static Supplier<String>textSupplier(com.atlassian.sal.api.message.I18nResolver i18nResolver, String key, String... params)static Supplier<String>textSupplier(com.opensymphony.xwork2.TextProvider textProvider, String key, String... params)One can utilize this method together with BambooPreconditions:BambooPreconditions.checkThat(1==1, ArithmeticException::new, textSupplier("arithmetic.incomplete", "1==1"));Thanks to a supplier creation of the error message is deferred until error condition actually occurs.
-
-
-
Method Detail
-
getText
public static String getText(com.opensymphony.xwork2.TextProvider textProvider, String msg, String... params)
-
getText
public static String getText(com.atlassian.sal.api.message.I18nResolver i18nResolver, String msg, String... params)
-
textSupplier
public static Supplier<String> textSupplier(com.opensymphony.xwork2.TextProvider textProvider, String key, String... params)
One can utilize this method together with BambooPreconditions:BambooPreconditions.checkThat(1==1, ArithmeticException::new, textSupplier("arithmetic.incomplete", "1==1"));Thanks to a supplier creation of the error message is deferred until error condition actually occurs.- Parameters:
textProvider- A TextProvider instancekey- Key to look up in the text providerparams- Parameters for the given key- Returns:
-
textSupplier
public static Supplier<String> textSupplier(com.atlassian.sal.api.message.I18nResolver i18nResolver, String key, String... params)
-
getHtml
public static String getHtml(com.opensymphony.xwork2.TextProvider textProvider, String msg, String... params)
-
getHtml
public static String getHtml(com.atlassian.sal.api.message.I18nResolver i18nResolver, String msg, String... params)
-
getTextProvider
public static com.opensymphony.xwork2.TextProvider getTextProvider()
-
-