package cn.estsh.i3plus.pojo.base.util;

import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class StringUtil {

	public static boolean isEmpty(Object obj){

		if(obj ==null || obj.toString().trim().equals("")){
			return true;
		}

		return false;
	}

	/**
	 * 获取对象所有属性名
	 * @param clazz
	 * @return
	 */
	public static String[] getFields(Class clazz) {
		Field[] fields = clazz.getDeclaredFields();
		String[] fieldNames = new String[fields.length];
		for(int i=0;i<fields.length;i++){
			fieldNames[i]=fields[i].getName();
		}
		return fieldNames;
	}

	public static boolean isEmptyAndNull(Object obj){

		if(obj == null || obj.toString().trim().equals("") || "null".equalsIgnoreCase(obj.toString().trim())){
			return true;
		}

		return false;
	}
}
