public final class ObjectKit extends Object
| Modifier and Type | Method and Description |
|---|---|
<T extends Serializable> |
clone(T obj)
Clone 一个对象
|
static byte[] |
toByteArray(Object obj)
对象转数组
|
static byte[] |
toCompressByteArray(Object obj)
对象转数组
|
static byte[] |
toCompressByteArray(Object obj,
String password)
对象转数组
|
static <T> T |
toDecompressObject(byte[] bytes)
byte数组转对象
|
static <T> T |
toDecompressObject(byte[] bytes,
String password)
byte数组转对象
|
static Double |
toDouble(Object obj) |
static Float |
toFloat(Object obj) |
static Integer |
toInteger(Object obj) |
static Long |
toLong(Object obj) |
static Map |
toMap(Object obj)
object 转化为 map,借助jackson
|
static <T> T |
toObject(byte[] bytes)
byte数组转对象
|
public static byte[] toByteArray(Object obj)
obj - public static <T> T toObject(byte[] bytes)
bytes - public static byte[] toCompressByteArray(Object obj)
obj - public static <T> T toDecompressObject(byte[] bytes)
bytes - public static byte[] toCompressByteArray(Object obj, String password)
obj - password - 加密密码public static <T> T toDecompressObject(byte[] bytes,
String password)
bytes - password - 加密密码public static Map toMap(Object obj) throws com.fasterxml.jackson.core.JsonProcessingException
obj - com.fasterxml.jackson.core.JsonProcessingExceptionpublic <T extends Serializable> T clone(T obj)
T - obj - Copyright © 2021. All rights reserved.