类 SerializationUtils
- java.lang.Object
-
- com.baomidou.mybatisplus.core.toolkit.SerializationUtils
-
public class SerializationUtils extends java.lang.Objectcopy from spring-core#org.springframework.util.SerializationUtils version 5.2.8
- 从以下版本开始:
- 1.0
-
-
构造器概要
构造器 构造器 说明 SerializationUtils()
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static <T extends java.io.Serializable>
Tclone(T object)Deep clone anObjectusing serialization.static java.lang.Objectdeserialize(byte[] bytes)Deserialize the byte array into an object.static byte[]serialize(java.lang.Object object)Serialize the given object to a byte array.
-
-
-
方法详细资料
-
clone
public static <T extends java.io.Serializable> T clone(T object)
Deep clone anObjectusing serialization.This is many times slower than writing clone methods by hand on all objects in your object graph. However, for complex object graphs, or for those that don't support deep cloning this can be a simple alternative implementation. Of course all the objects must be
Serializable.- 类型参数:
T- the type of the object involved- 参数:
object- theSerializableobject to clone- 返回:
- the cloned object
-
serialize
public static byte[] serialize(java.lang.Object object)
Serialize the given object to a byte array.- 参数:
object- the object to serialize- 返回:
- an array of bytes representing the object in a portable fashion
-
deserialize
public static java.lang.Object deserialize(byte[] bytes)
Deserialize the byte array into an object.- 参数:
bytes- a serialized object- 返回:
- the result of deserializing the bytes
-
-