package com.alipay.face.verify.fintechfacedemo.utils;

import com.alibaba.fastjson.JSONObject;

public class TextUtil {

    public static boolean isNotEmpty(String str) {
        return str != null && !str.isEmpty();
    }


    public static boolean isNotEmpty(JSONObject jsonObject, String key) {
        return jsonObject != null && jsonObject.containsKey(key);
    }

    public static String getNotNullValue(JSONObject jsonObject, String key) {
        if (isNotEmpty(jsonObject, key)) {
            return jsonObject.getString(key);
        }
        return "";
    }

}
