123456789101112131415161718192021222324252627282930313233 |
- package me.yoqi.deleteallcontacts.utils;
- import java.util.List;
- import java.util.regex.Pattern;
- public class Utils {
- /** 判断list 是否为空
- * @param contactIds
- * @return
- */
- public static boolean isEmpty(List<String> contactIds) {
- return contactIds.size() > 0;
- }
- /** 判断 string是否为数字
- * @param contactId
- * @return
- */
- public static boolean isNumber(String contactId) {
- Pattern pattern = Pattern.compile("^[-\\+]?[\\d]*$");
- return pattern.matcher(contactId).matches();
- }
- /** 判断string是否为空
- * @param id
- * @return
- */
- public static boolean isEmpty(String id) {
- return id.length() > 0;
- }
- }
|