com.alibaba.tmq.common.util.ListUtil Maven / Gradle / Ivy
package com.alibaba.tmq.common.util;
import java.util.List;
/**
* 列表相关工具
* @author tianyao.myc
*
*/
public class ListUtil {
/**
* 获取列表最后一个元素
* list
*
*/
public static T acquireLastObject(List list) {
return list.get(list.size() - 1);
}
/**
* 判断列表是否为空
* list
*
*/
@SuppressWarnings("rawtypes")
public static boolean isEmpty(List list) {
return (null == list || list.size() <= 0);
}
}