package cn.superdesk.uniorder.common.numerical;

import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;

/**
 * @Description: Java类作用描述
 * @Author: linjinyu
 * @CreateDate: 2020/11/18 下午8:07
 * @UpdateUser: linjinyu
 * @UpdateDate: 2020/11/18 下午8:07
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
@NoArgsConstructor
@Slf4j
public class AnLongUtils {

	public static Long getLong(String input) {

		if (StringUtils.isBlank(input)) {
			return null;
		}

		if (input.equals("null")) {
			return 0L;
		}

		return Long.parseLong(input);
	}

	public static Long getLong(Object input) {

		String temp = "";
		if (null != input) {
			temp = String.valueOf(input);
		}

//		if(StringUtils.isEmpty(temp)){
//
//		}

		if (StringUtils.isBlank(temp)) {
			return null;
		}


		return Long.parseLong(temp);
	}

}