Class SerializationUtils
java.lang.Object
io.github.blyznytsiaorg.bibernate.cache.utils.SerializationUtils
Utility class for serializing and deserializing objects using Kryo serialization.
- Since:
- 1.0
- Author:
- Blyzhnytsia Team
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic <T> Optional<T> deserialize(Class<T> entityClass, byte[] entity) Deserializes the provided byte array into an object of the specified entity class using Kryo deserialization.static <T> byte[]Serializes the provided entity object into a byte array using Kryo serialization.
- 
Constructor Details- 
SerializationUtilspublic SerializationUtils()
 
- 
- 
Method Details- 
serializeSerializes the provided entity object into a byte array using Kryo serialization.- Type Parameters:
- T- the type of the entity object
- Parameters:
- entityClass- the class of the entity object
- entity- the entity object to serialize
- Returns:
- the byte array representing the serialized entity
 
- 
deserializeDeserializes the provided byte array into an object of the specified entity class using Kryo deserialization.- Type Parameters:
- T- the type of the entity object
- Parameters:
- entityClass- the class of the entity object
- entity- the byte array representing the serialized entity
- Returns:
- an Optional containing the deserialized entity object, or an empty Optional if deserialization fails
 
 
-