Package fi.moprim.tmd.sdk.utilities
Class StringUtils
- java.lang.Object
-
- fi.moprim.tmd.sdk.utilities.StringUtils
-
public class StringUtils extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static intSHORTEN_ENDstatic intSHORTEN_MIDDLEstatic intSHORTEN_START
-
Constructor Summary
Constructors Constructor Description StringUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringfirstUpper(java.lang.String string)static java.lang.StringgetDuration(double seconds)static java.lang.StringgetDuration(double seconds, boolean keepShort)static booleanisNotEmpty(java.lang.String string)static booleansame(java.lang.String s1, java.lang.String s2)static java.lang.Stringshorten(java.lang.String text, int size, int mode)Shortens a given String "text" down to size length, indicating the shortening by three dots ("...").
-
-
-
Field Detail
-
SHORTEN_START
public static final int SHORTEN_START
- See Also:
- Constant Field Values
-
SHORTEN_MIDDLE
public static final int SHORTEN_MIDDLE
- See Also:
- Constant Field Values
-
SHORTEN_END
public static final int SHORTEN_END
- See Also:
- Constant Field Values
-
-
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 shortensize- The size the text is to shortened to.mode- The mode in which the string shall be shortened- Returns:
- The shortened string.
-
-