78 lines
1.7 KiB
Java
78 lines
1.7 KiB
Java
package at.fhj.swd.dailyhelper.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 = "weather")
|
|
public class Weather {
|
|
@PrimaryKey
|
|
@NonNull
|
|
@ColumnInfo(name = "date")
|
|
private String date;
|
|
@ColumnInfo(name = "description")
|
|
private String description;
|
|
@ColumnInfo(name = "icon")
|
|
private String icon;
|
|
@ColumnInfo(name = "temp")
|
|
private double temp;
|
|
@ColumnInfo(name = "humidity")
|
|
private double humidity;
|
|
|
|
|
|
public Weather(@NonNull String date, String description, String icon, double temp, double humidity) {
|
|
this.date = date;
|
|
this.description = description;
|
|
this.icon = icon;
|
|
this.temp = temp;
|
|
this.humidity = humidity;
|
|
}
|
|
|
|
public String getDate() {
|
|
return date;
|
|
}
|
|
|
|
public void setDate(String date) {
|
|
this.date = date;
|
|
}
|
|
|
|
public String getDescription() {
|
|
return description;
|
|
}
|
|
|
|
public void setDescription(String description) {
|
|
this.description = description;
|
|
}
|
|
|
|
public String getIcon() {
|
|
return icon;
|
|
}
|
|
|
|
public void setIcon(String icon) {
|
|
this.icon = icon;
|
|
}
|
|
|
|
public double getTemp() {
|
|
return temp;
|
|
}
|
|
|
|
public void setTemp(double temp) {
|
|
this.temp = temp;
|
|
}
|
|
|
|
public double getHumidity() {
|
|
return humidity;
|
|
}
|
|
|
|
public void setHumidity(double humidity) {
|
|
this.humidity = humidity;
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return date + ", " + temp + ", " + humidity;
|
|
}
|
|
}
|
|
|