Created
July 6, 2019 21:09
-
-
Save ghahramani/ccbe2e9960dc914aa1a7c1e7bcc9c3a5 to your computer and use it in GitHub Desktop.
This is a simple class which will be converted to a JSON
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
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