package com.example.iot_controlhost.model;

import androidx.annotation.NonNull;
import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Id;

import java.util.Date;

@Entity
public class Log {

    /**
     * 日志唯一Id
     */
    @Id(autoincrement = true)
    private Long id;
    /**
     * 标签/类型
     */
    @NonNull
    String tag;
    /**
     * 级别
     */
    @NonNull
    int level;
    /**
     * 产生时间
     */
    @NonNull
    Date datetime;
    /**
     * 日志内容
     */
    @NonNull
    String message;

    @Generated(hash = 1364647056)
    public Log() {
    }

    public Log(@NonNull String tag, int level, @NonNull Date datetime, @NonNull String message) {
        this.tag = tag;
        this.level = level;
        this.datetime = datetime;
        this.message = message;
    }

    @Generated(hash = 1896824052)
    public Log(Long id, @NonNull String tag, int level, @NonNull Date datetime, @NonNull String message) {
        this.id = id;
        this.tag = tag;
        this.level = level;
        this.datetime = datetime;
        this.message = message;
    }

    public Long getId() {
        return this.id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getTag() {
        return this.tag;
    }

    public void setTag(String tag) {
        this.tag = tag;
    }

    public int getLevel() {
        return this.level;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    public Date getDatetime() {
        return this.datetime;
    }

    public void setDatetime(Date datetime) {
        this.datetime = datetime;
    }

    public String getMessage() {
        return this.message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

}
