Class Utils


  • public class Utils
    extends Object
    Generic utility methods.
    • Method Detail

      • readResourceToString

        public static String readResourceToString​(String path)
        Read a resource to a UTF-8 string.
      • jsonMerge

        public static void jsonMerge​(org.json.JSONObject a,
                                     org.json.JSONObject b)
        Recursively merge JSONObject 'b' into 'a'.
      • longToMac

        public static String longToMac​(long addr)
        Convert a MAC address in integer (6-byte) representation to string notation.
      • bytesToHex

        public static String bytesToHex​(byte[] b)
        Return a hex representation of the given byte array.
      • deepCopy

        public static <T> T deepCopy​(T obj,
                                     Class<T> classOfT)
        Return a deep copy using gson. DO NOT USE if performance is critical.