Module org.refcodes.factory
Package org.refcodes.factory
Interface Packager<UNPACK,PACK,PACKEXC extends Exception>
- Type Parameters:
UNPACK
- The type of the unpacked data.PACK
- The type of the packed data.PACKEXC
- The exception being thrown when packaging failed.
- All Known Subinterfaces:
Packager.PackageProcessor<UNPACK,
PACK, UNPACKEXC, PACKEXC>
public interface Packager<UNPACK,PACK,PACKEXC extends Exception>
The
Packager
interface defines methods to pack instances and return
the packed, wrapped or boxed instances. Any data being packed with
toPackaged(Object)
must be unpackable with the according counterpart
method Packager.Extractor.toExtracted(Object)
without loss of information.-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Packager.Extractor<PACK,
UNPACK, UNPACKEXC extends Exception> ThePackager.Extractor
interface defines methods to unpack instances and return the unpacked, unwrapped or unboxed instances.static interface
ThePackager.PackageProcessor
type combines aPackager
with anPackager.Extractor
to package and extract in one module. -
Method Summary
Modifier and TypeMethodDescriptiontoPackaged
(UNPACK aUnpacked) Packs the provided instance, e.g. it is wrapped or boxed with additional information.
-
Method Details
-
toPackaged
Packs the provided instance, e.g. it is wrapped or boxed with additional information.- Parameters:
aUnpacked
- The data to be packed (enriched).- Returns:
- The packed data.
- Throws:
PACKEXC
- thrown in case packing the data failed.
-