yakworks.api.problem.Violation.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of api-messages Show documentation
Show all versions of api-messages Show documentation
Models and SPI for message service, api results and problems.
package yakworks.api.problem
import yakworks.api.AsMap
import yakworks.message.MsgKey
/**
* @author Joshua Burnett (@basejump)
* @since 7.0.8
*/
interface Violation : AsMap {
val msg: MsgKey?
val code: String?
get() = if (msg != null) msg!!.code else null
val field: String?
get() = null
val message: String?
get() = null
override fun asMap(): Map {
val hmap: MutableMap = HashMap()
hmap["code"] = this.code
hmap["field"] = field
hmap["message"] = message
return hmap
}
}