package rasel.lunar.launcher.model

import rasel.lunar.launcher.utils.JamoUtils

class NewsData : RssDataInterface {

    var title : String? = ""
    var link : String? = ""
    var guid : String? = ""
    var description : String? = ""
    var pubDate : Long = 0L
    var source : String? = ""

    constructor(title: String?,link: String?) {
        this.link = link
        this.title = title
    }

    override fun title(): String {
        return  title ?: ""
    }

    override fun thumbnailUrl(): String {
        return source ?: ""
    }

    override fun originPage(): String {
        return link ?: ""
    }

    override fun description(): String {
        return description ?: ""
    }

    override fun pubDate(): Long {
        return pubDate
    }

    override fun category(): RssDataType {
        return RssDataType.NewsFeed
    }
    override fun getCho(): String? {
        return JamoUtils.split(title()).joinToString("")
    }
}