added location dao and repository

This commit is contained in:
Sem van der Hoeven
2020-12-14 12:13:15 +01:00
parent 204d45cece
commit 23d23bead4
5 changed files with 84 additions and 3 deletions

View File

@@ -1,15 +1,33 @@
package com.a1.nextlocation.data;
import androidx.annotation.NonNull;
import androidx.room.Entity;
import androidx.room.PrimaryKey;
import org.jetbrains.annotations.NotNull;
@Entity(tableName = "location")
public class Location {
@PrimaryKey
@NonNull
private String name;
private String coordinates;
private String description;
public Location(@NotNull String name, String coordinates, String description) {
this.name = name;
this.coordinates = coordinates;
this.description = description;
}
@NotNull
public String getName() {
return name;
}
public void setName(String name) {
public void setName(@NotNull String name) {
this.name = name;
}