mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-08 17:20:11 +08:00
YAML supported
This commit is contained in:
parent
e7c49eb471
commit
d27f6b8574
@ -27,4 +27,31 @@ public class MiraiConfigSection<T> extends ConcurrentSkipListMap<String, T> {
|
|||||||
return (D)(this.getOrDefault(key,defaultV));
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user