Package 

Class NamedRunnable

  • All Implemented Interfaces:
    com.datadog.android.internal.thread.NamedExecutionUnit , java.lang.Runnable

    
    public final class NamedRunnable
     implements NamedExecutionUnit, 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 String name
    • Method Summary

      Modifier and Type Method Description
      String getName() Sanitized name after replacing spaces, colons, periods, and commas with underscores (_), and converting all characters to lowercase.
      • Methods inherited from class com.datadog.android.internal.thread.NamedRunnable

        run
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • NamedRunnable

        NamedRunnable(String name, Runnable runnable)
        Parameters:
        name - The name to associate with this runnable, will be sanitized for safe usage.
        runnable - The actual runnable to be executed when run is called.
    • Method Detail

      • getName

         String getName()

        Sanitized name after replacing spaces, colons, periods, and commas with underscores (_), and converting all characters to lowercase.