Package com.codebarrel.api
Interface Zipper
- All Known Implementing Classes:
ZipperImpl
public interface Zipper
Wrapper around ZipUtils which provides a dependency injectable interface to aid testing
-
Method Summary
Modifier and TypeMethodDescription<T> T
unzipDeserializedJson
(byte[] payload, Class<T> clazz) Unarchive the given payload with the provided clssbyte[]
zipSerializedJson
(Object payload) Archives an object payload into bytes
-
Method Details
-
zipSerializedJson
Archives an object payload into bytes- Parameters:
payload
- Object to compress- Returns:
- zipped representation in bytes
-
unzipDeserializedJson
Unarchive the given payload with the provided clss- Type Parameters:
T
- Class of the unarchived payload- Parameters:
payload
- Archived bytesclazz
- Class to enforce generics- Returns:
- Unarchived object
-