Description
Add UriResolver to generate random android.net.Uri instances and UriStrategy to control URI scheme distribution. Both live in the :android module under dev.appoutlet.some.android.
-
Scope and constraints
UriStrategy is a sealed interface extending Strategy with variants: Random (any scheme), Content, File, Url (https only). Default is Random. It lives in dev.appoutlet.some.android.strategy.
UriResolver uses Uri.parse(...) with randomized scheme, host, path, and optional query/fragment. It lives in dev.appoutlet.some.android.resolver.
- The resolver fetches the strategy once in
init: strategyProvider.get<UriStrategy>() ?: UriStrategy.default.
canResolve() uses exact type matching: type == typeOf<Uri>().
resolve() delegates scheme choice to a when on the strategy variant and generates the rest of the URI randomly.
- Includes JVM unit tests verifying each strategy variant produces correct schemes,
canResolve behavior, and general URI shape.
- Follows the same patterns as
StringResolver + StringStrategy from :core.
-
References
Scope
In scope: UriStrategy sealed interface + variants, UriResolver, JVM unit tests.
Out of scope: registering the resolver in AndroidTypeResolverProvider (ticket #14).
Acceptance criteria
Description
Add
UriResolverto generate randomandroid.net.Uriinstances andUriStrategyto control URI scheme distribution. Both live in the:androidmodule underdev.appoutlet.some.android.Scope and constraints
UriStrategyis a sealed interface extendingStrategywith variants:Random(any scheme),Content,File,Url(https only). Default isRandom. It lives indev.appoutlet.some.android.strategy.UriResolverusesUri.parse(...)with randomized scheme, host, path, and optional query/fragment. It lives indev.appoutlet.some.android.resolver.init:strategyProvider.get<UriStrategy>() ?: UriStrategy.default.canResolve()uses exact type matching:type == typeOf<Uri>().resolve()delegates scheme choice to awhenon the strategy variant and generates the rest of the URI randomly.canResolvebehavior, and general URI shape.StringResolver+StringStrategyfrom:core.References
Scope
In scope:
UriStrategysealed interface + variants,UriResolver, JVM unit tests.Out of scope: registering the resolver in
AndroidTypeResolverProvider(ticket #14).Acceptance criteria
UriResolver.canResolve(typeOf<Uri>())returns trueUriResolver.canResolve(typeOf<String>())returns falseUriStrategy.Random(default) generates URIs with any scheme from[content, file, https]UriStrategy.Urlgenerates onlyhttps://...URIsUriStrategy.Contentgenerates onlycontent://...URIsUriStrategy.Filegenerates onlyfile://...URIsUri.parse()without throwingandroid.jarand run as plain JVM unit tests