Class PassThru<T>


  • public final class PassThru<T>
    extends Object
    A pass-thru envelope for a json-serializable object. The intent of this class is to wrap an object in an envelope so as to avoid serialization within a context that may be missing dependencies required to deserialize the object. For example we use this when passing objects through the NodeManager that may refer to classes that the NodeManager does not have, yet the objects need to be relayed from the NodeManager to its child process that does have the required classes.
    • Method Detail

      • wrap

        public static <T> PassThru<T> wrap​(Class<T> clazz,
                                           T object)
        Wraps the given object as a pass-thru object
        Parameters:
        clazz - the type of the object that should be used on deserialization
        object - the object
        Returns:
        the wrapped object
      • unwrap

        public T unwrap()
        Unwraps the object.
        Returns:
        the unwrapped object.