diff --git a/mirai-core/src/main/java/net/mamoe/mirai/utils/config/MiraiConfigSection.java b/mirai-core/src/main/java/net/mamoe/mirai/utils/config/MiraiConfigSection.java index cea0be010..256c005a4 100644 --- a/mirai-core/src/main/java/net/mamoe/mirai/utils/config/MiraiConfigSection.java +++ b/mirai-core/src/main/java/net/mamoe/mirai/utils/config/MiraiConfigSection.java @@ -27,4 +27,31 @@ public class MiraiConfigSection extends ConcurrentSkipListMap { 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 MiraiConfigSection getTypedSection(String key){ + return (MiraiConfigSection) this.getAs(key); + } + + @SuppressWarnings("unchecked") + public MiraiConfigSection getSection(String key){ + return (MiraiConfigSection) this.getAs(key); + } + + }