Class MessageFormatUtil


  • public final class MessageFormatUtil
    extends java.lang.Object
    This file is a helper class for internal usage only. Be aware that its API and functionality may be changed in future.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private MessageFormatUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String format​(java.lang.String pattern, java.lang.Object... arguments)
      This method provides a generic way for formatting strings.
      • Methods inherited from class java.lang.Object

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

      • MessageFormatUtil

        private MessageFormatUtil()
    • Method Detail

      • format

        public static java.lang.String format​(java.lang.String pattern,
                                              java.lang.Object... arguments)
        This method provides a generic way for formatting strings. Indexed arguments can be referred with {index}, to escape curly braces you have to double them.

        Only basic escaping is allowed, single quotes in a set of curly braces are not supported and multiple escaped braces in a row are also not supported

        Allowed {{{0}}} Allowed '{0}' Allowed '{{{0}}}'

        Not allowed {{'{0}'}} Not allowed {{{{{0}}}}}

        Parameters:
        pattern - to format
        arguments - arguments
        Returns:
        The formatted string