Created
May 8, 2019 12:59
-
-
Save jsfan3/3a66e711fd0fd233c5e4c467184adb7a to your computer and use it in GitHub Desktop.
Java Runnable With Arg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface RunnableWithArg<T> { | |
/** | |
* Similar to the runnable interface but it accepts an argument | |
* | |
* @param arg any type of argument | |
*/ | |
public void run(T arg); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example of usage
Suppose to have a method like the following that needs a RunnableWithArg as callback:
in this case, the implementation of
getTakeAvatarCallback()
can start with: