YAML supported

This commit is contained in:
liujiahua123123 2019-08-21 11:19:04 +08:00
parent e7c49eb471
commit d27f6b8574

View File

@ -27,4 +27,31 @@ public class MiraiConfigSection<T> extends ConcurrentSkipListMap<String, T> {
return (D)(this.getOrDefault(key,defaultV));
}
public Integer getInt(String key){
return Integer.valueOf(this.get(key).toString());
}
public Double getDouble(String key){
return Double.valueOf(this.get(key).toString());
}
public Float getFloat(String key){
return Float.valueOf(this.get(key).toString());
}
public String getString(String key){
return String.valueOf(this.get(key));
}
@SuppressWarnings("unchecked")
public <D extends T> MiraiConfigSection<D> getTypedSection(String key){
return (MiraiConfigSection<D>) this.getAs(key);
}
@SuppressWarnings("unchecked")
public MiraiConfigSection<Object> getSection(String key){
return (MiraiConfigSection<Object>) this.getAs(key);
}
}