Skip to content

Instantly share code, notes, and snippets.

@ghahramani
Created July 6, 2019 21:09
Show Gist options
  • Save ghahramani/ccbe2e9960dc914aa1a7c1e7bcc9c3a5 to your computer and use it in GitHub Desktop.
Save ghahramani/ccbe2e9960dc914aa1a7c1e7bcc9c3a5 to your computer and use it in GitHub Desktop.
This is a simple class which will be converted to a JSON
class ProblemVM(
val url: String,
val message: String,
val status: Int,
val params: MutableMap<String, Any> = HashMap()
) {
fun with(key: String, value: Any): ProblemVM {
params[key] = value
return this
}
fun with(values: HashMap<String, Any>): ProblemVM {
params.clear()
params.putAll(values)
return this
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment