78 lines
1.7 KiB
Java
78 lines
1.7 KiB
Java
package at.fhj.airkoality.model;
|
|
|
|
import android.arch.persistence.room.ColumnInfo;
|
|
import android.arch.persistence.room.Entity;
|
|
import android.arch.persistence.room.PrimaryKey;
|
|
import android.support.annotation.NonNull;
|
|
|
|
@Entity(tableName = "location")
|
|
public class Location {
|
|
@PrimaryKey
|
|
@NonNull
|
|
@ColumnInfo(name = "location")
|
|
private String location;
|
|
@ColumnInfo(name = "city")
|
|
private String city;
|
|
@ColumnInfo(name = "country")
|
|
private String country;
|
|
@ColumnInfo(name = "latitude")
|
|
private double latitude;
|
|
@ColumnInfo(name = "longitude")
|
|
private double longitude;
|
|
|
|
|
|
public Location(@NonNull String location, String city, String country, double latitude, double longitude) {
|
|
this.location = location;
|
|
this.city = city;
|
|
this.country = country;
|
|
this.latitude = latitude;
|
|
this.longitude = longitude;
|
|
}
|
|
|
|
public String getLocation() {
|
|
return location;
|
|
}
|
|
|
|
public void setLocation(String location) {
|
|
this.location = location;
|
|
}
|
|
|
|
public String getCity() {
|
|
return city;
|
|
}
|
|
|
|
public void setCity(String city) {
|
|
this.city = city;
|
|
}
|
|
|
|
public String getCountry() {
|
|
return country;
|
|
}
|
|
|
|
public void setCountry(String country) {
|
|
this.country = country;
|
|
}
|
|
|
|
public double getLatitude() {
|
|
return latitude;
|
|
}
|
|
|
|
public void setLatitude(double latitude) {
|
|
this.latitude = latitude;
|
|
}
|
|
|
|
public double getLongitude() {
|
|
return longitude;
|
|
}
|
|
|
|
public void setLongitude(double longitude) {
|
|
this.longitude = longitude;
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return location + ", " + city + ", " + country;
|
|
}
|
|
}
|
|
|