Class StringUtil


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

      Constructors 
      Constructor Description
      StringUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String conversion​(java.io.InputStream inputStream)
      File input stream convert to String.
      static java.lang.String mask​(java.lang.String str, int range, boolean direction, char mask, java.lang.String allow)
      Mask a string.
      • Methods inherited from class java.lang.Object

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

      • StringUtil

        public StringUtil()
    • Method Detail

      • conversion

        public static java.lang.String conversion​(java.io.InputStream inputStream)
                                           throws java.io.IOException
        File input stream convert to String.
        Parameters:
        inputStream - file stream
        Returns:
        string
        Throws:
        java.io.IOException - IOException
      • mask

        public static java.lang.String mask​(java.lang.String str,
                                            int range,
                                            boolean direction,
                                            char mask,
                                            java.lang.String allow)
        Mask a string.
        Parameters:
        str - string.
        range - range of output plain text.
        direction - direction of mask. true : left, ***4567, false : right, 1234***.
        mask - mask character.
        allow - exceptional allow string (regular expression).
        Returns:
        the masked string, or empty string if null or empty string inputs.