forked from ReVanced/revanced-patcher
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: convert Patch to abstract class
BREAKING CHANGE: Patch class is now an abstract class. You must implement it. You can use anonymous implements, like done in the tests.
- Loading branch information
Showing
2 changed files
with
56 additions
and
57 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,5 @@ | ||
package net.revanced.patcher.patch | ||
|
||
class Patch(val patchName: String, val fn: () -> PatchResult) { | ||
fun execute(): PatchResult { | ||
return fn() | ||
} | ||
abstract class Patch(val patchName: String) { | ||
abstract fun execute(): PatchResult | ||
} | ||
|
||
|
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