yakworks.message.MsgMultiKey.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.message
/**
* MsgKey that has multiple codes to lookup.
* Should use order to look them up
*
* @author Joshua Burnett (@basejump)
* @since 0.3.0
*/
@Suppress("UNUSED_PARAMETER")
interface MsgMultiKey : MsgKey {
var codes: List?
get() = null
set(value) { throw java.lang.UnsupportedOperationException("setter not implemented") }
/**
* the wrapped MsgKey
*/
var msgKey: MsgKey?
get() = null
set(value) {
throw UnsupportedOperationException("setter not implemented")
}
override var code: String?
get() = msgKey!!.code
set(value) {
msgKey!!.code = value
}
override var args: MsgArgs?
get() = msgKey!!.args
set(value) {
msgKey!!.args = value
}
override var fallbackMessage: String?
get() = msgKey!!.fallbackMessage
set(value) {
msgKey!!.fallbackMessage = value
}
companion object {
/**
* key from code and msgKey
*/
@JvmStatic
fun of(msgKey: MsgKey?): DefaultMsgMultiKey? {
return DefaultMsgMultiKey(msgKey)
}
@JvmStatic
fun ofCodes(codes: List?): DefaultMsgMultiKey? {
return DefaultMsgMultiKey(codes)
}
}
}