Created
July 26, 2019 01:46
-
-
Save Malinskiy/fb93f4c75e8eb4bf193471c05cd43e7f to your computer and use it in GitHub Desktop.
Metric.kt
This file contains hidden or 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
abstract class Metric<T, in Context>( | |
val provider: (Context) -> T, | |
val assigner: (ExecutionReport, T) -> Unit | |
) { | |
open fun get(context: Context, report: ExecutionReport) { | |
val value = provider(context) | |
assigner(report, value) | |
value | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment