官术网_书友最值得收藏!

Extension functions

The common and utility functions are grouped in a file named Extension.kt (you can specify any name you want). It contains top-level functions that can be used anywhere in the project.

Complete the Extension.kt file:

    /**
* Builds the insert query for the specified message
*/
fun insertQuery(m: Message): Messages.(UpdateBuilder<*>) -> Unit =
{
if (m.id != null) it[id] = m.id
it[content] = m.content
it[location] = m.location
}

/**
* Create the message object from Result row
* @return message
*/
fun ResultRow.getMessage() =
Message(this[Messages.content], this[Messages.location],
this
[Messages.id])

// Other extension functions
主站蜘蛛池模板: 墨脱县| 昌宁县| 沁阳市| 瓮安县| 灵宝市| 阿城市| 阿克苏市| 射洪县| 阳泉市| 毕节市| 迁西县| 宁阳县| 浪卡子县| 固镇县| 石棉县| 斗六市| 拜泉县| 聊城市| 永登县| 清苑县| 含山县| 塔城市| 竹溪县| 洪雅县| 昌吉市| 侯马市| 东乌珠穆沁旗| 奉贤区| 吉安县| 旌德县| 肥东县| 萝北县| 南汇区| 兴隆县| 邢台市| 库尔勒市| 八宿县| 石棉县| 蚌埠市| 张家口市| 渭南市|