Package com.motorro.keeplink.uri.data

Data objects to represent URI components

Types

Link copied to clipboard
interface ComponentValue

Returns component value

Link copied to clipboard
fun interface HashComponent

Has URI hash

Link copied to clipboard
data class Param(val name: String, val value: String)

Used to pass cross-platform key-value param. Native JS can't import Map and there is no auto-mapping to object, so map values are passed as an array of such objects.

Link copied to clipboard
fun interface PathComponent

Has URI path

Link copied to clipboard
abstract class PshComponents : PathComponent, SearchComponent, HashComponent

Path/Search/Hash components

Link copied to clipboard
class PshComponentsImpl(    var mPath: Array<String>? = null,     var mSearch: Array<Param>? = null,     var mHash: String? = null) : PshComponents

Data storage for deserializer

Link copied to clipboard
fun interface SearchComponent

Has URI search

Link copied to clipboard
data class Utm(    val utmSource: String,     val utmMedium: String?,     val utmCampaign: String?,     val utmTerm: String?,     val utmContent: String?) : SearchComponent

(Urchin Tracking Module params)https://en.wikipedia.org/wiki/UTM_parameters

Functions

Link copied to clipboard
fun Array<Param>.getValue(name: String): String?

Sugar to get value from array of params in map-like style

Link copied to clipboard
infix fun String.of(value: String): Param

Sugar to create a param

Link copied to clipboard
fun parseUtm(searchComponent: SearchComponent): Utm

Gets Utm from search component

Link copied to clipboard
fun Array<Param>.toMap(): Map<String, String>

Converts array of Param objects to Map

Link copied to clipboard
fun Map<String, String>.toParams(): Array<Param>

Converts map to array of Param objects

Link copied to clipboard
fun utm(utmSource: String): Utm

Creates UTM parameters