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 byte[] base64Decode​(byte[] data)
      Decode a Base64 byte array into a non-Base64 byte array.
      static byte[] base64Encode​(byte[] data)
      Encode a byte array into a Base64 byte array.
      static java.lang.String join​(java.lang.CharSequence delimiter, java.lang.Iterable<? extends java.lang.CharSequence> elements)
      Returns a new String composed of copies of the CharSequence elements joined together with a copy of the specified delimiter.
      • Methods inherited from class java.lang.Object

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

      • StringUtils

        public StringUtils()
    • Method Detail

      • join

        public static java.lang.String join​(java.lang.CharSequence delimiter,
                                            java.lang.Iterable<? extends java.lang.CharSequence> elements)
        Returns a new String composed of copies of the CharSequence elements joined together with a copy of the specified delimiter. Like `Strings.join()` but works on Android before API 26.
        Parameters:
        delimiter - a sequence of characters that is used to separate each of the elements in the resulting String
        elements - an Iterable that will have its elements joined together
        Returns:
        a new String that is composed from the elements argument
      • base64Encode

        public static byte[] base64Encode​(byte[] data)
        Encode a byte array into a Base64 byte array.
        Parameters:
        data - The byte array to encode
        Returns:
        The byte array encoded as Byte64
      • base64Decode

        public static byte[] base64Decode​(byte[] data)
        Decode a Base64 byte array into a non-Base64 byte array.
        Parameters:
        data - The byte array to decode.
        Returns:
        Byte array decoded from Base64.