package com.ronald.gantengtimesheet.config;
import com.ronald.gantengtimesheet.db.ConfigEntity;
import com.ronald.gantengtimesheet.db.ConfigEntityCollection;
public class Config {
private Config() {}
public static Integer getDefaultReportDuration() {
ConfigEntity ce = ConfigEntityCollection.getInstance().getConfigEntity(ConfigEntityCollection.Config.DEFAULT_REPORT_DURATION.name);
assert ce.getDataType().equals(Integer.class.getName());
return Integer.valueOf(ce.getValue());
}
public static String getFrom() {
ConfigEntity ce = ConfigEntityCollection.getInstance().getConfigEntity(ConfigEntityCollection.Config.FROM.name);
return ce.getValue();
}
public static String getTo() {
ConfigEntity ce = ConfigEntityCollection.getInstance().getConfigEntity(ConfigEntityCollection.Config.TO.name);
return ce.getValue();
}
public static Double getDefaultRate() {
ConfigEntity ce = ConfigEntityCollection.getInstance().getConfigEntity(ConfigEntityCollection.Config.DEFAULT_RATE.name);
assert ce.getDataType().equals(Double.class.getName());
return Double.valueOf(ce.getValue());
}
public static String getLastDirectory() {
ConfigEntity ce = ConfigEntityCollection.getInstance().getConfigEntity(ConfigEntityCollection.Config.LAST_DIRECTORY.name);
return ce.getValue();
}
public static String getNotes() {
ConfigEntity ce = ConfigEntityCollection.getInstance().getConfigEntity(ConfigEntityCollection.Config.NOTES.name);
return ce.getValue();
}
}