Description
Add resolvers for android.util.Pair, android.os.UserHandle, and android.graphics.Color. Each resolver lives in dev.appoutlet.some.android.resolver.
-
Scope and constraints
PairResolver — Pair(first, second) where first and second are resolved by delegating to the chain for generic type arguments. Constructor receives random: Random only; type args are extracted from KType.arguments in resolve().
UserHandleResolver — guarded by Build.VERSION.SDK_INT >= 24; generates via UserHandle.of(uid) with random non-system UID (≥ 10000). Falls back to null on API < 24. Constructor receives random: Random only.
ColorResolver (for android.graphics.Color) — guarded by Build.VERSION.SDK_INT >= 26; generates via Color.valueOf(red, green, blue) with randomized RGB values. Falls back to null on API < 26. Constructor receives random: Random only.
- Each
canResolve() uses exact type matching via typeOf<T>().
- Each resolver has its own JVM unit test class. UserHandle and Color tests verify type matching and API-level guard logic. Pair tests verify both generic args are resolved via chain delegation.
- Follows the same patterns as simple resolvers from
:core.
-
References
Scope
In scope: 3 resolver classes + 3 test classes.
Out of scope: Account and Location (handled by existing ClassResolver), registering resolvers in AndroidTypeResolverProvider (ticket #14).
Acceptance criteria
Description
Add resolvers for
android.util.Pair,android.os.UserHandle, andandroid.graphics.Color. Each resolver lives indev.appoutlet.some.android.resolver.Scope and constraints
PairResolver—Pair(first, second)wherefirstandsecondare resolved by delegating to thechainfor generic type arguments. Constructor receivesrandom: Randomonly; type args are extracted fromKType.argumentsinresolve().UserHandleResolver— guarded byBuild.VERSION.SDK_INT >= 24; generates viaUserHandle.of(uid)with random non-system UID (≥ 10000). Falls back tonullon API < 24. Constructor receivesrandom: Randomonly.ColorResolver(forandroid.graphics.Color) — guarded byBuild.VERSION.SDK_INT >= 26; generates viaColor.valueOf(red, green, blue)with randomized RGB values. Falls back tonullon API < 26. Constructor receivesrandom: Randomonly.canResolve()uses exact type matching viatypeOf<T>().:core.References
Scope
In scope: 3 resolver classes + 3 test classes.
Out of scope: Account and Location (handled by existing
ClassResolver), registering resolvers inAndroidTypeResolverProvider(ticket #14).Acceptance criteria
PairResolvergenerates pairs wherefirstandsecondare resolved via chain delegation for generic type argsUserHandleResolvergenerates aUserHandlewhenBuild.VERSION.SDK_INT >= 24, returns null otherwiseColorResolvergenerates anandroid.graphics.ColorwhenBuild.VERSION.SDK_INT >= 26, returns null otherwisecanResolvereturns true for its own type and false for other typesandroid.jarand run as plain JVM unit tests