mirror of https://github.com/tasks/tasks
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
86 lines
1.5 KiB
Java
86 lines
1.5 KiB
Java
package org.tasks.data;
|
|
|
|
import androidx.room.ColumnInfo;
|
|
import androidx.room.Entity;
|
|
import androidx.room.Ignore;
|
|
import androidx.room.PrimaryKey;
|
|
|
|
@Entity(tableName = "alarms")
|
|
public class Alarm {
|
|
|
|
@PrimaryKey(autoGenerate = true)
|
|
@ColumnInfo(name = "_id")
|
|
private transient long id;
|
|
|
|
@ColumnInfo(name = "task")
|
|
private transient long task;
|
|
|
|
@ColumnInfo(name = "time")
|
|
private long time;
|
|
|
|
public Alarm() {}
|
|
|
|
@Ignore
|
|
public Alarm(long task, long time) {
|
|
this.task = task;
|
|
this.time = time;
|
|
}
|
|
|
|
public long getId() {
|
|
return id;
|
|
}
|
|
|
|
public void setId(long id) {
|
|
this.id = id;
|
|
}
|
|
|
|
public long getTask() {
|
|
return task;
|
|
}
|
|
|
|
public void setTask(long task) {
|
|
this.task = task;
|
|
}
|
|
|
|
public long getTime() {
|
|
return time;
|
|
}
|
|
|
|
public void setTime(long time) {
|
|
this.time = time;
|
|
}
|
|
|
|
@Override
|
|
public boolean equals(Object o) {
|
|
if (this == o) {
|
|
return true;
|
|
}
|
|
if (o == null || getClass() != o.getClass()) {
|
|
return false;
|
|
}
|
|
|
|
Alarm alarm = (Alarm) o;
|
|
|
|
if (id != alarm.id) {
|
|
return false;
|
|
}
|
|
if (task != alarm.task) {
|
|
return false;
|
|
}
|
|
return time == alarm.time;
|
|
}
|
|
|
|
@Override
|
|
public int hashCode() {
|
|
int result = (int) (id ^ (id >>> 32));
|
|
result = 31 * result + (int) (task ^ (task >>> 32));
|
|
result = 31 * result + (int) (time ^ (time >>> 32));
|
|
return result;
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return "Alarm{" + "id=" + id + ", task=" + task + ", time=" + time + '}';
|
|
}
|
|
}
|