-
- All Implemented Interfaces:
-
java.lang.Runnable
public final class NamedRunnable implements Runnable
A wrapper around a Runnable that assigns it a sanitized, lowercase name.
This class is useful when you want to associate a human-readable name with a Runnable, for logging, debugging, or tracking purposes.
The provided name is sanitized by replacing spaces, colons, periods, and commas with underscores (
_), and converting all characters to lowercase.
-
-
Field Summary
Fields Modifier and Type Field Description private final StringsanitizedName
-
Constructor Summary
Constructors Constructor Description NamedRunnable(String name, Runnable runnable)
-
Method Summary
Modifier and Type Method Description final StringgetSanitizedName()Sanitized name after replacing spaces, colons, periods, and commas with underscores ( _), and converting all characters to lowercase.-
-
Method Detail
-
getSanitizedName
final String getSanitizedName()
Sanitized name after replacing spaces, colons, periods, and commas with underscores (
_), and converting all characters to lowercase.
-
-
-
-