Interface TransmittableThreadLocal.Transmitter.Transmittee<C,​B>

    • Method Detail

      • capture

        @NonNull
        C capture()
        Capture.

        NOTE:

        • do NOT return null.
        • do NOT throw any exceptions, just ignored.
        Returns:
        the capture data of transmittee
        Since:
        2.14.0
      • replay

        @NonNull
        B replay​(@NonNull
                 C captured)
        Replay.

        NOTE:

        • do NOT return null.
        • do NOT throw any exceptions, just ignored.
        Parameters:
        captured - the capture data of transmittee, the return value of method capture()
        Returns:
        the backup data of transmittee
        Since:
        2.14.0
      • clear

        @NonNull
        B clear()
        Clear.

        NOTE:

        • do NOT return null.
        • do NOT throw any exceptions, just ignored.

        Semantically, the code `B backup = clear();` is same as `B backup = replay(EMPTY_CAPTURE);`.

        The reason for providing this method is:

        1. lead to more readable code
        2. need not provide the constant EMPTY_CAPTURE.
        Returns:
        the backup data of transmittee
        Since:
        2.14.0
      • restore

        void restore​(@NonNull
                     B backup)
        Restore.

        NOTE:
        do NOT throw any exceptions, just ignored.

        Parameters:
        backup - the backup data of transmittee, the return value of methods replay(Object) or clear()
        Since:
        2.14.0
        See Also:
        replay(Object), clear()