package com.quyunshuo.androidbaseframemvvm.common.enums

enum class WeekEnum(val code:Int,val content:String)  {
    SUNDAY(7, "sunday"),
    MONDAY(1, "monday"),
    TUESDAY(2, "tuesday"),
    WEDNESDAY(3,"wednesday"),
    THURSDAY(4, "thursday"),
    FRIDAY(5, "friday"),
    SATURDAY(6, "saturday");

    companion object {
        fun getEnumByValue(code: Int): WeekEnum? {

            for (anEnum in WeekEnum.values()) {
                if (anEnum.code == code) {
                    return anEnum
                }
            }
            return null
        }

    }
}