Module org.refcodes.factory
Package org.refcodes.factory
Interface Packager.Extractor<PACK,UNPACK,UNPACKEXC extends Exception>
- Type Parameters:
UNPACK
- The type of the unpacked data.PACK
- The type of the packed data.UNPACKEXC
- The exception being thrown when unpacking failed.
- All Known Subinterfaces:
Packager.PackageProcessor<UNPACK,
PACK, UNPACKEXC, PACKEXC>
public static interface Packager.Extractor<PACK,UNPACK,UNPACKEXC extends Exception>
The
Packager.Extractor
interface defines methods to unpack instances and
return the unpacked, unwrapped or unboxed instances. Any data being
packed with Packager.toPackaged(Object)
must be unpackable with
the according counterpart method toExtracted(Object)
without
loss of information.-
Method Summary
Modifier and TypeMethodDescriptiondefault UNPACK
fromPackaged
(PACK aPacked) Method for potential better code expressiveness, the same astoExtracted(Object)
.toExtracted
(PACK aPacked) Unpacks an instance packed with the thePackager.toPackaged(Object)
operation Depending on the implementation and the return type, as a result a new data instance is returned or the same instance is being modified (and returned).
-
Method Details
-
toExtracted
Unpacks an instance packed with the thePackager.toPackaged(Object)
operation Depending on the implementation and the return type, as a result a new data instance is returned or the same instance is being modified (and returned).- Parameters:
aPacked
- The packed data to be unpacked.- Returns:
- The unpacked data.
- Throws:
UNPACKEXC
- thrown in case unpacking the data failed.
-
fromPackaged
Method for potential better code expressiveness, the same astoExtracted(Object)
.- Parameters:
aPacked
- The packed data to be unpacked.- Returns:
- The unpacked data.
- Throws:
UNPACKEXC
- thrown in case unpacking the data failed.
-