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

yakworks.message.MsgMultiKey.kt Maven / Gradle / Ivy

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy