Class CleanupTask.MutableCloseTask

All Implemented Interfaces:
CleanupTask<Exception>
Enclosing interface:
CleanupTask<EX extends Exception>

public static final class CleanupTask.MutableCloseTask extends CleanupTask.CloseAndResetTask
A simple cleanup task for cleaning up a Mutable. No cleanup will occur if its value is null or no AutoCloseable, the Mutable will be set to null afterwards.
  • Constructor Details

    • MutableCloseTask

      public MutableCloseTask(String descriptor, org.apache.commons.lang3.mutable.Mutable<?> mutable)
      Creates a new CleanupTask.MutableCloseTask for the designated Mutable and the designated descriptor using Cleanup's default logger.
      Parameters:
      descriptor - A string that meaningfully describes this task when used for logging etc. or null.
      mutable - The mutable which to AutoCloseable.close() and set to null.
    • MutableCloseTask

      public MutableCloseTask(String descriptor, Logger logger, org.apache.commons.lang3.mutable.Mutable<?> mutable)
      Creates a new CleanupTask.MutableCloseTask for the designated Mutable, the designated descriptor and the designated logger.
      Parameters:
      descriptor - A string that meaningfully describes this task when used for logging etc. or null.
      logger - The logger for messages and/or problems, e. g. unexpected exceptions.
      mutable - The mutable which to AutoCloseable.close() and set to null.