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

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
主站蜘蛛池模板: 大方县| 澄江县| 杭锦后旗| 桑日县| 南康市| 贺兰县| 开远市| 会昌县| 惠东县| 彰武县| 鄂州市| 习水县| 六枝特区| 莎车县| 兰坪| 务川| 菏泽市| 忻城县| 京山县| 平原县| 临朐县| 九江市| 汤原县| 绍兴县| 玉田县| 名山县| 大余县| 西藏| 林州市| 新巴尔虎右旗| 宁化县| 菏泽市| 林芝县| 东至县| 梧州市| 游戏| 惠州市| 夏河县| 宝清县| 永川市| 新河县|