Interface TempDirDeletionStrategy.DeletionResult
- Enclosing interface:
TempDirDeletionStrategy
public static sealed interface TempDirDeletionStrategy.DeletionResult
Represents the result of a
TempDirDeletionStrategy.delete(Path, AnnotatedElementContext, ExtensionContext) operation,
including any paths that could not be deleted.- Since:
- 6.1
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceBuilder forTempDirDeletionStrategy.DeletionResult. -
Method Summary
Modifier and TypeMethodDescriptionCreate a newTempDirDeletionStrategy.DeletionResult.Builderfor the supplied root directory.failures()Return the list of failures that occurred during deletion.default booleanReturntrueif the deletion was successful, i.e., no failures were recorded.rootDir()Return the root temporary directory of this deletion operation.Convert this result to aTempDirDeletionStrategy.DeletionExceptionsummarizing all failures.
-
Method Details
-
builder
Create a newTempDirDeletionStrategy.DeletionResult.Builderfor the supplied root directory.- Parameters:
rootDir- the root temporary directory; nevernull- Returns:
- a new
Builder; nevernull
-
rootDir
Path rootDir()Return the root temporary directory of this deletion operation.- Returns:
- the root directory; never
null
-
failures
List<TempDirDeletionStrategy.DeletionFailure> failures()Return the list of failures that occurred during deletion.- Returns:
- the list of failures; never
null
-
isSuccessful
default boolean isSuccessful()Returntrueif the deletion was successful, i.e., no failures were recorded. -
toException
Optional<TempDirDeletionStrategy.DeletionException> toException()Convert this result to aTempDirDeletionStrategy.DeletionExceptionsummarizing all failures.Must only be called if
isSuccessful()returnsfalse.- Returns:
- an
TempDirDeletionStrategy.DeletionException, if the deletion was successful; otherwise, empty; nevernull
-