# SystemUtils

public class SystemUtils

Created by weiqinxiao on 15/10/14.

## Constructors

SystemUtils
Link copied to clipboard
public void SystemUtils()

## Properties

applicationContext
Link copied to clipboard
public static Context applicationContext

## Functions

deduplicate
Link copied to clipboard
public static List<T> deduplicate<T>(List<T> list)
简化重载方法，按泛型T的toString去做key
public static List<T> deduplicate<T>(List<T> list, Deduplicate<T> deduplicate)
对List去重。 假如key重复，则已插入的元素会被后面的元素所覆盖。复杂度2N。
enumArrayToOrdinalArray
Link copied to clipboard
public static Array<int> enumArrayToOrdinalArray<T extends Enum<T>>(Array<T> enumArray)
枚举数组转换为其ordinal值数组
getApplicationContext
Link copied to clipboard
public static Context getApplicationContext()
getCurrentProcessName
Link copied to clipboard
public static String getCurrentProcessName(Context context)
isChannelIdValid
Link copied to clipboard
public static boolean isChannelIdValid(String channelId)
isConversationTypeValid
Link copied to clipboard
public static boolean isConversationTypeValid(ConversationType conversationType)
isMainProcess
Link copied to clipboard
public static boolean isMainProcess(Context context)
当前进程是否为主进程。
isParameterValid
Link copied to clipboard
public static boolean isParameterValid(ConversationType conversationType, String targetId, String channelId)
isTargetIdValid
Link copied to clipboard
public static boolean isTargetIdValid(String targetId)
isValidAppKey
Link copied to clipboard
public static boolean isValidAppKey(String appKey)
服务端 appKey 目前的策略:只包含小写字母或数字。 客户端为了便于以后的扩展，增加大写字母的逻辑。 校验字符串是否只包含 a-z、A-Z、0-9.
judgeListInvalid
Link copied to clipboard
public static boolean judgeListInvalid(List<String> keyArray, OperationCallback callback)
judgeMapInvalid
Link copied to clipboard
public static boolean judgeMapInvalid(Map<String, String> expansion, OperationCallback callback)
judgeUIDInvalid
Link copied to clipboard
public static boolean judgeUIDInvalid(String messageUId, OperationCallback callback)
listCmpDataToString
Link copied to clipboard
public static String listCmpDataToString(List<CmpData> list)
将 List转换成 String。 每个 CmpData 之间用 , 分隔， CmpData 的 addr、protocol、weight 之间用 ; 分隔
listToString
Link copied to clipboard
public static String listToString(List<String> list)
将 List转换成 String。 每个 String 之间用 , 分隔
mapToString
Link copied to clipboard
public static String mapToString(Map map)
Map 转 string。 每个 entry 之间用 ; 分隔， key 和 value 之间用:分隔
nonSupportSuperGroup
Link copied to clipboard
public static boolean nonSupportSuperGroup(ConversationType conversationType)
registerReceiverCompat
Link copied to clipboard
public static Intent registerReceiverCompat(Context context, BroadcastReceiver receiver, IntentFilter filter)
统一封装广播注册，方便统一处理权限、合规等问题。
setApplicationContext
Link copied to clipboard
public static void setApplicationContext(Context context)