Class StringUtils


  • public class StringUtils
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      StringUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String firstUpper​(java.lang.String string)  
      static java.lang.String getDuration​(double seconds)  
      static java.lang.String getDuration​(double seconds, boolean keepShort)  
      static boolean isNotEmpty​(java.lang.String string)  
      static boolean same​(java.lang.String s1, java.lang.String s2)  
      static java.lang.String shorten​(java.lang.String text, int size, int mode)
      Shortens a given String "text" down to size length, indicating the shortening by three dots ("...").
      • Methods inherited from class java.lang.Object

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

      • StringUtils

        public StringUtils()
    • Method Detail

      • isNotEmpty

        public static boolean isNotEmpty​(java.lang.String string)
      • getDuration

        public static java.lang.String getDuration​(double seconds)
      • getDuration

        public static java.lang.String getDuration​(double seconds,
                                                   boolean keepShort)
      • same

        public static boolean same​(java.lang.String s1,
                                   java.lang.String s2)
      • firstUpper

        public static java.lang.String firstUpper​(java.lang.String string)
      • shorten

        @NonNull
        public static java.lang.String shorten​(java.lang.String text,
                                               int size,
                                               int mode)
        Shortens a given String "text" down to size length, indicating the shortening by three dots ("..."). Mode determines the position of the dots and where the text will be cut off.
        Parameters:
        text - The string to shorten
        size - The size the text is to shortened to.
        mode - The mode in which the string shall be shortened
        Returns:
        The shortened string.