1
zyy
2026-04-03 4fefff17528a878d345ff3311c297a66a671b8d6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package com.yami.trading.huobi.websocket.service.huobi.utils;
 
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
 
public class DataUtils {
 
  public static String getDataKey(JSONObject jsonObject) {
    String key = "data";
    Object dataObj = jsonObject.get(key);
    if (dataObj == null) {
      key = "tick";
      dataObj = jsonObject.get("tick");
    }
 
    if (dataObj == null) {
      return null;
    }
    return key;
  }
 
  public static boolean isJSONArray(Object object) {
    if (object instanceof JSONArray) {
      return true;
    }
    return false;
  }
 
  public static boolean isJSONObject(Object object) {
    if (object instanceof JSONObject) {
      return true;
    }
    return false;
  }
 
 
  public static void timeWait(Long millis) {
    try {
      System.out.println("time wait " + millis + " ms");
      Thread.sleep(millis);
    } catch (InterruptedException e) {
    }
  }
}