MainSchedule.kt 1.27 KB
Newer Older
Robert Hitt's avatar
Robert Hitt committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package srct.whatsopen.model

import com.google.gson.annotations.SerializedName

import io.realm.RealmList
import io.realm.RealmObject

open class MainSchedule : RealmObject, Schedule {

    @SerializedName("open_times")
    private var mOpenTimesList: RealmList<OpenTimes>? = null

    @SerializedName("valid_start")
    var validStart: String? = null

    @SerializedName("valid_end")
    private var validEnd: String? = null

    @SerializedName("twenty_four_hours")
    var openTwentyFourHours: Boolean? = null

Robert Hitt's avatar
Robert Hitt committed
22
23
    constructor(openTimesList: RealmList<OpenTimes>, validStart: String, validEnd: String,
                openTwentyFourHours: Boolean) {
Robert Hitt's avatar
Robert Hitt committed
24
25
26
        mOpenTimesList = openTimesList
        this.validStart = validStart
        this.validEnd = validEnd
Robert Hitt's avatar
Robert Hitt committed
27
        this.openTwentyFourHours = openTwentyFourHours
Robert Hitt's avatar
Robert Hitt committed
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
    }

    constructor() {}

    override fun getValidEnd(): String? {
        return validEnd
    }

    fun setValidEnd(validEnd: String) {
        this.validEnd = validEnd
    }

    override fun getOpenTimesList(): RealmList<OpenTimes>? {
        return mOpenTimesList
    }

    fun setOpenTimesList(openTimesList: RealmList<OpenTimes>) {
        mOpenTimesList = openTimesList
    }
Robert Hitt's avatar
Robert Hitt committed
47
48
49
50

    override fun isOpen24Hours(): Boolean? {
        return openTwentyFourHours
    }
Robert Hitt's avatar
Robert Hitt committed
51
}