Mica 官方网站

vuePress-theme-reco 如梦技术    2021
Mica 官方网站
文档
组件集
VIP
博文
友情链接
关于
GitHub

如梦技术

0

Article

9

Tag

文档
组件集
VIP
博文
友情链接
关于
GitHub
  • 认识 Mica

    • Mica 简介
    • 快速开始
    • 发行版本
  • mica工具类

    • mica-core模块说明
    • $工具集
    • SystemCode
    • ServiceException
    • Bean-validator分组
    • StringUtil
    • SystemUtil
    • BeanUtil
    • FileUtil
    • JsonUtil
    • UrlUtil
    • WebUtil
    • INetUtil
    • IoUtil
    • NumberUtil
    • ConvertUtil
    • ThreadUtil
    • PathUtil
    • HexUtil
    • AesUtil
    • DesUtil
    • RsaUtil
    • Base64Util
    • DigestUtil
    • DateUtil
    • ObjectUtil
    • ResourceUtil
    • ThreadLocalUtil
    • RuntimeUtil
    • ReflectUtil
    • ClassUtil
    • CollectionUtil
    • Unchecked(Lambda受检异常)
    • Exceptions
    • DecimalNum
    • Once
    • CountMap
    • Version
    • xpath解析xml

vuePress-theme-reco 如梦技术    2021

集合工具类


如梦技术

# 集合工具类

类名: CollectionUtil

# isNotEmpty

/**
 * Return {@code true} if the supplied Collection is not {@code null} or empty.
 * Otherwise, return {@code false}.
 *
 * @param collection the Collection to check
 * @return whether the given Collection is not empty
 */
CollectionUtil.isNotEmpty(Collection<?> collection);

# isNotEmpty

/**
 * Return {@code true} if the supplied Map is not {@code null} or empty.
 * Otherwise, return {@code false}.
 *
 * @param map the Map to check
 * @return whether the given Map is not empty
 */
CollectionUtil.isNotEmpty(Map<?,?> map);

# contains

/**
 * Check whether the given Array contains the given element.
 *
 * @param array   the Array to check
 * @param element the element to look for
 * @param <T>     The generic tag
 * @return {@code true} if found, {@code false} else
 */
CollectionUtil.contains(T[] array, T element);

# concat

/**
 * Concatenates 2 arrays
 *
 * @param one   数组1
 * @param other 数组2
 * @return 新数组
 */
CollectionUtil.concat(String[] one, String[] other);

# concat

/**
 * Concatenates 2 arrays
 *
 * @param one   数组1
 * @param other 数组2
 * @param clazz 数组类
 * @return 新数组
 */
CollectionUtil.concat(T[] one, T[] other, Class<T> clazz);

# ofImmutableSet

/**
 * 不可变 Set
 *
 * @param es  对象
 * @param <E> 泛型
 * @return 集合
 */
CollectionUtil.ofImmutableSet(E es);

# ofImmutableList

/**
 * 不可变 List
 *
 * @param es  对象
 * @param <E> 泛型
 * @return 集合
 */
CollectionUtil.ofImmutableList(E es);

# toList

/**
 * Iterable 转换为List集合
 *
 * @param elements Iterable
 * @param <E>      泛型
 * @return 集合
 */
CollectionUtil.toList(Iterable<E> elements);

# toMap

/**
 * 将key value 数组转为 map
 *
 * @param keysValues key value 数组
 * @param <K>        key
 * @param <V>        value
 * @return map 集合
 */
CollectionUtil.toMap(Object keysValues);

# partition

/**
 * list 分片
 *
 * @param list List
 * @param size 分片大小
 * @param <T>  泛型
 * @return List 分片
 */
CollectionUtil.partition(List<T> list, int size);

# get

/**
 */
CollectionUtil collectionUtil = new CollectionUtil();
collectionUtil.get(int index);

# size

/**
 */
CollectionUtil collectionUtil = new CollectionUtil();
collectionUtil.size();

# isEmpty

/**
 */
CollectionUtil collectionUtil = new CollectionUtil();
collectionUtil.isEmpty();

# 微信 vs 公众号

如梦技术

精彩内容每日推荐!!!

编辑此页面
更新时间: 9/8/2020, 8:42:56 PM
  • isNotEmpty
  • isNotEmpty
  • contains
  • concat
  • concat
  • ofImmutableSet
  • ofImmutableList
  • toList
  • toMap
  • partition
  • get
  • size
  • isEmpty
  • 微信 vs 公众号