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>
Enclosing interface:
Packager<UNPACK,PACK,PACKEXC extends Exception>

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 Type
    Method
    Description
    default UNPACK
    fromPackaged(PACK aPacked)
    Method for potential better code expressiveness, the same as toExtracted(Object).
    toExtracted(PACK aPacked)
    Unpacks an instance packed with the the Packager.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

      UNPACK toExtracted(PACK aPacked) throws UNPACKEXC
      Unpacks an instance packed with the the Packager.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

      default UNPACK fromPackaged(PACK aPacked) throws UNPACKEXC
      Method for potential better code expressiveness, the same as toExtracted(Object).
      Parameters:
      aPacked - The packed data to be unpacked.
      Returns:
      The unpacked data.
      Throws:
      UNPACKEXC - thrown in case unpacking the data failed.