Class ServerToolkits


  • public final class ServerToolkits
    extends Object
    工具包
    Since:
    JDK 1.7
    Author:
    jinyu(foxinmy@gmail.com)
    • Constructor Detail

      • ServerToolkits

        public ServerToolkits()
    • Method Detail

      • generateRandomString

        public static String generateRandomString​(int length)
        返回一个定长的随机字符串(包含数字和大小写字母)
        Parameters:
        length - 随机数的长度
        Returns:
      • makeConstructorAccessible

        public static void makeConstructorAccessible​(Constructor<?> ctor)
        构造器设置为可见
        Parameters:
        ctor -
      • digestSHA1

        public static String digestSHA1​(String content)
        SHA1签名
        Parameters:
        content - 待签名字符串
        Returns:
        签名后的字符串
      • getBytesUtf8

        public static byte[] getBytesUtf8​(String content)
      • newStringUtf8

        public static String newStringUtf8​(byte[] bytes)
      • isBlank

        public static boolean isBlank​(CharSequence cs)
        判断字符串是否为空
        Parameters:
        cs -
        Returns: