package com.key.simplekeyboard.data;

import androidx.room.Entity;
import androidx.room.PrimaryKey;

import com.key.simplekeyboard.SimpleKeyboardSkins;

import java.util.ArrayList;
import java.util.List;


@Entity(tableName = SimpleKeyboardSkins.Table_Name)
public class Otherdata {
    @PrimaryKey(autoGenerate = true)
    public int id;
    public String preview;
    public String thumb;
    public String className;
    public String title;
    public String zipUrl;
    public Boolean islike;
    public String getPreview() {
        return preview;
    }

    public void setPreview(String preview) {
        this.preview = preview;
    }

    public String getThumb() {
        return thumb;
    }

    public void setThumb(String thumb) {
        this.thumb = thumb;
    }

    public String getClassName() {
        return className;
    }

    public void setClassName(String className) {
        this.className = className;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getZipUrl() {
        return zipUrl;
    }

    public void setZipUrl(String zipUrl) {
        this.zipUrl = zipUrl;
    }

    public Boolean getIslike() {
        return islike;
    }

    public void setIslike(Boolean islike) {
        this.islike = islike;
    }


    public List<Otherdata> filterByName(String input, List<Otherdata> dataList) {
        List<Otherdata> filteredList = new ArrayList<>();
        for (Otherdata data : dataList) {
            if (data.getTitle().toLowerCase().contains(input.toLowerCase())) {
                filteredList.add(data);
            }
        }
        return filteredList;
    }

}
