Class Utils


  • public class Utils
    extends Object
    • Constructor Detail

      • Utils

        public Utils()
    • Method Detail

      • read

        public static String read​(Reader reader,
                                  int length)
      • toString

        public static String toString​(Date date)
      • loadClass

        public static Class<?> loadClass​(String className)
      • getStartTime

        public static final Date getStartTime()
      • murmurhash2_64

        public static long murmurhash2_64​(String text)
      • murmurhash2_64

        public static long murmurhash2_64​(byte[] data,
                                          int length,
                                          int seed)
        murmur hash 2.0, The murmur hash is a relatively fast hash function from http://murmurhash.googlepages.com/ for platforms with efficient multiplication.
      • md5Bytes

        public static byte[] md5Bytes​(String text)
      • putLong

        public static void putLong​(byte[] b,
                                   int off,
                                   long val)
      • equals

        public static boolean equals​(Object a,
                                     Object b)
      • hex

        public static String hex​(int hash)
      • hex

        public static String hex​(long hash)
      • hex_t

        public static String hex_t​(long hash)
      • fnv_64

        public static long fnv_64​(String input)
      • fnv_64_lower

        public static long fnv_64_lower​(String key)
      • fnv_32_lower

        public static long fnv_32_lower​(String key)
      • loadFromFile

        public static void loadFromFile​(String path,
                                        Set<String> set)
      • getIfNull

        public static <T> T getIfNull​(T object,
                                      T defaultValue)
        Returns a default value if the object passed is null.