-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into feat/add-gaid-support
- Loading branch information
Showing
4 changed files
with
89 additions
and
5 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 |
---|---|---|
|
@@ -6,7 +6,7 @@ plugins { | |
id 'kotlin-kapt' | ||
} | ||
|
||
version='2.0.49' | ||
version='2.0.50' | ||
|
||
android { | ||
compileSdkVersion 34 | ||
|
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
81 changes: 81 additions & 0 deletions
81
personalization-sdk/src/main/kotlin/com/personalization/api/params/ProfileParams.kt
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 |
---|---|---|
@@ -0,0 +1,81 @@ | ||
package com.personalization.api.params | ||
|
||
import org.json.JSONObject | ||
import java.util.Date | ||
|
||
//TODO use data loader | ||
class ProfileParams private constructor( | ||
private val params: JSONObject = JSONObject() | ||
) { | ||
|
||
class Builder { | ||
|
||
private val params: JSONObject = JSONObject() | ||
|
||
fun put(param: String, value: String): Builder { | ||
params.put(param, value) | ||
return this | ||
} | ||
|
||
fun put(param: String, value: Int): Builder { | ||
params.put(param, value) | ||
return this | ||
} | ||
|
||
fun put(param: String, value: Float): Builder { | ||
params.put(param, value) | ||
return this | ||
} | ||
|
||
fun put(param: String, value: Date): Builder { | ||
params.put(param, value) | ||
return this | ||
} | ||
|
||
fun put(param: String, value: Boolean): Builder { | ||
params.put(param, value) | ||
return this | ||
} | ||
|
||
fun put(param: String, value: JSONObject): Builder { | ||
params.put(param, value) | ||
return this | ||
} | ||
|
||
fun put(param: String, value: Array<String>): Builder { | ||
params.put(param, value) | ||
return this | ||
} | ||
|
||
fun put(param: String, value: Array<Int>): Builder { | ||
params.put(param, value) | ||
return this | ||
} | ||
|
||
fun put(param: String, value: Array<Float>): Builder { | ||
params.put(param, value) | ||
return this | ||
} | ||
|
||
fun put(param: String, value: Array<Date>): Builder { | ||
params.put(param, value) | ||
return this | ||
} | ||
|
||
fun put(param: String, value: Array<Boolean>): Builder { | ||
params.put(param, value) | ||
return this | ||
} | ||
|
||
fun put(param: String, value: Array<JSONObject>): Builder { | ||
params.put(param, value) | ||
return this | ||
} | ||
|
||
fun build(): ProfileParams { | ||
return ProfileParams(params) | ||
} | ||
} | ||
|
||
fun toJson(): JSONObject = params | ||
} |
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