Commit d27f6b85 authored by liujiahua123123's avatar liujiahua123123

YAML supported

parent e7c49eb4
......@@ -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);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment