public abstract class AlipayUtils extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
static <V> Map<String,V> |
cleanupMap(Map<String,V> map)
清除字典中值为空的项。
|
static long |
fromRadix62Str(String str)
62进制字符串转为数字
|
static String |
getFileSuffix(byte[] bytes)
获取文件的真实后缀名。
|
static String |
getLocalNetWorkIp()
获取本机的网络IP
|
static String |
getMimeType(byte[] bytes)
获取文件的真实媒体类型。
|
static Map<?,?> |
parseJson(String body)
把JSON字符串转化为Map结构。
|
static <T extends AlipayResponse> |
parseResponse(String json,
Class<T> clazz)
把JSON字符串解释为对象结构。
|
static String |
toRadix62Str(long num,
int length)
将数字转为62进制
|
public static String getFileSuffix(byte[] bytes)
bytes - 文件字节流public static String getMimeType(byte[] bytes)
bytes - 文件字节流public static <V> Map<String,V> cleanupMap(Map<String,V> map)
V - 泛型map - 待清除的字典public static Map<?,?> parseJson(String body)
body - JSON字符串public static <T extends AlipayResponse> T parseResponse(String json, Class<T> clazz) throws AlipayApiException
T - API响应类型json - JSON字符串clazz - API响应类AlipayApiExceptionpublic static String getLocalNetWorkIp()
public static String toRadix62Str(long num, int length)
num - Long 型数字length - 转换后的字符串长度,不足则左侧补0public static long fromRadix62Str(String str)
str - 编码后的62进制字符串Copyright © 2025. All rights reserved.