check-flagged-apis: add Flag value class
Add a value class to represent Flag names. We could use plain Strings but having a dedicated class (with no overhead compared to String) makes the intent of the code much clearer. Bug: 334870672 Test: m check-flagged-apis && check-flagged-apis Change-Id: Icdd4fb97d3fd49e507b7559504ea173a3dc52dea
This commit is contained in:
parent
e0179976cd
commit
dc3fc2e0bc
1 changed files with 13 additions and 0 deletions
|
@ -57,6 +57,19 @@ internal value class Symbol(val name: String) {
|
|||
override fun toString(): String = name.toString()
|
||||
}
|
||||
|
||||
/**
|
||||
* Class representing the fully qualified name of an aconfig flag.
|
||||
*
|
||||
* This includes both the flag's package and name, separated by a dot, e.g.:
|
||||
* <pre>
|
||||
* com.android.aconfig.test.disabled_ro
|
||||
* <pre>
|
||||
*/
|
||||
@JvmInline
|
||||
internal value class Flag(val name: String) {
|
||||
override fun toString(): String = name.toString()
|
||||
}
|
||||
|
||||
class CheckCommand : CliktCommand() {
|
||||
override fun run() {
|
||||
println("hello world")
|
||||
|
|
Loading…
Reference in a new issue