All Downloads are FREE. Search and download functionalities are using the official Maven repository.

yakworks.api.problem.Violation.kt Maven / Gradle / Ivy

There is a newer version: 3.14
Show newest version
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
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy