/*
 * This file is generated by jOOQ.
 */
package com.nisemoe.generated.tables.records


import com.nisemoe.generated.tables.UpdateUserQueue

import java.time.LocalDateTime
import java.time.OffsetDateTime

import org.jooq.Field
import org.jooq.Record1
import org.jooq.Record9
import org.jooq.Row9
import org.jooq.impl.UpdatableRecordImpl


/**
 * This class is generated by jOOQ.
 */
@Suppress("UNCHECKED_CAST")
open class UpdateUserQueueRecord private constructor() : UpdatableRecordImpl<UpdateUserQueueRecord>(UpdateUserQueue.UPDATE_USER_QUEUE), Record9<Int?, Long?, Boolean?, LocalDateTime?, OffsetDateTime?, Int?, Int?, Long?, Boolean?> {

    open var id: Int?
        set(value): Unit = set(0, value)
        get(): Int? = get(0) as Int?

    open var userId: Long
        set(value): Unit = set(1, value)
        get(): Long = get(1) as Long

    open var processed: Boolean?
        set(value): Unit = set(2, value)
        get(): Boolean? = get(2) as Boolean?

    open var createdAt: LocalDateTime?
        set(value): Unit = set(3, value)
        get(): LocalDateTime? = get(3) as LocalDateTime?

    open var processedAt: OffsetDateTime?
        set(value): Unit = set(4, value)
        get(): OffsetDateTime? = get(4) as OffsetDateTime?

    open var progressCurrent: Int?
        set(value): Unit = set(5, value)
        get(): Int? = get(5) as Int?

    open var progressTotal: Int?
        set(value): Unit = set(6, value)
        get(): Int? = get(6) as Int?

    open var addedByUserId: Long?
        set(value): Unit = set(7, value)
        get(): Long? = get(7) as Long?

    open var hasFailed: Boolean?
        set(value): Unit = set(8, value)
        get(): Boolean? = get(8) as Boolean?

    // -------------------------------------------------------------------------
    // Primary key information
    // -------------------------------------------------------------------------

    override fun key(): Record1<Int?> = super.key() as Record1<Int?>

    // -------------------------------------------------------------------------
    // Record9 type implementation
    // -------------------------------------------------------------------------

    override fun fieldsRow(): Row9<Int?, Long?, Boolean?, LocalDateTime?, OffsetDateTime?, Int?, Int?, Long?, Boolean?> = super.fieldsRow() as Row9<Int?, Long?, Boolean?, LocalDateTime?, OffsetDateTime?, Int?, Int?, Long?, Boolean?>
    override fun valuesRow(): Row9<Int?, Long?, Boolean?, LocalDateTime?, OffsetDateTime?, Int?, Int?, Long?, Boolean?> = super.valuesRow() as Row9<Int?, Long?, Boolean?, LocalDateTime?, OffsetDateTime?, Int?, Int?, Long?, Boolean?>
    override fun field1(): Field<Int?> = UpdateUserQueue.UPDATE_USER_QUEUE.ID
    override fun field2(): Field<Long?> = UpdateUserQueue.UPDATE_USER_QUEUE.USER_ID
    override fun field3(): Field<Boolean?> = UpdateUserQueue.UPDATE_USER_QUEUE.PROCESSED
    override fun field4(): Field<LocalDateTime?> = UpdateUserQueue.UPDATE_USER_QUEUE.CREATED_AT
    override fun field5(): Field<OffsetDateTime?> = UpdateUserQueue.UPDATE_USER_QUEUE.PROCESSED_AT
    override fun field6(): Field<Int?> = UpdateUserQueue.UPDATE_USER_QUEUE.PROGRESS_CURRENT
    override fun field7(): Field<Int?> = UpdateUserQueue.UPDATE_USER_QUEUE.PROGRESS_TOTAL
    override fun field8(): Field<Long?> = UpdateUserQueue.UPDATE_USER_QUEUE.ADDED_BY_USER_ID
    override fun field9(): Field<Boolean?> = UpdateUserQueue.UPDATE_USER_QUEUE.HAS_FAILED
    override fun component1(): Int? = id
    override fun component2(): Long = userId
    override fun component3(): Boolean? = processed
    override fun component4(): LocalDateTime? = createdAt
    override fun component5(): OffsetDateTime? = processedAt
    override fun component6(): Int? = progressCurrent
    override fun component7(): Int? = progressTotal
    override fun component8(): Long? = addedByUserId
    override fun component9(): Boolean? = hasFailed
    override fun value1(): Int? = id
    override fun value2(): Long = userId
    override fun value3(): Boolean? = processed
    override fun value4(): LocalDateTime? = createdAt
    override fun value5(): OffsetDateTime? = processedAt
    override fun value6(): Int? = progressCurrent
    override fun value7(): Int? = progressTotal
    override fun value8(): Long? = addedByUserId
    override fun value9(): Boolean? = hasFailed

    override fun value1(value: Int?): UpdateUserQueueRecord {
        set(0, value)
        return this
    }

    override fun value2(value: Long?): UpdateUserQueueRecord {
        set(1, value)
        return this
    }

    override fun value3(value: Boolean?): UpdateUserQueueRecord {
        set(2, value)
        return this
    }

    override fun value4(value: LocalDateTime?): UpdateUserQueueRecord {
        set(3, value)
        return this
    }

    override fun value5(value: OffsetDateTime?): UpdateUserQueueRecord {
        set(4, value)
        return this
    }

    override fun value6(value: Int?): UpdateUserQueueRecord {
        set(5, value)
        return this
    }

    override fun value7(value: Int?): UpdateUserQueueRecord {
        set(6, value)
        return this
    }

    override fun value8(value: Long?): UpdateUserQueueRecord {
        set(7, value)
        return this
    }

    override fun value9(value: Boolean?): UpdateUserQueueRecord {
        set(8, value)
        return this
    }

    override fun values(value1: Int?, value2: Long?, value3: Boolean?, value4: LocalDateTime?, value5: OffsetDateTime?, value6: Int?, value7: Int?, value8: Long?, value9: Boolean?): UpdateUserQueueRecord {
        this.value1(value1)
        this.value2(value2)
        this.value3(value3)
        this.value4(value4)
        this.value5(value5)
        this.value6(value6)
        this.value7(value7)
        this.value8(value8)
        this.value9(value9)
        return this
    }

    /**
     * Create a detached, initialised UpdateUserQueueRecord
     */
    constructor(id: Int? = null, userId: Long, processed: Boolean? = null, createdAt: LocalDateTime? = null, processedAt: OffsetDateTime? = null, progressCurrent: Int? = null, progressTotal: Int? = null, addedByUserId: Long? = null, hasFailed: Boolean? = null): this() {
        this.id = id
        this.userId = userId
        this.processed = processed
        this.createdAt = createdAt
        this.processedAt = processedAt
        this.progressCurrent = progressCurrent
        this.progressTotal = progressTotal
        this.addedByUserId = addedByUserId
        this.hasFailed = hasFailed
        resetChangedOnNotNull()
    }
}
