Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Gk0Wk committed Aug 8, 2023
1 parent 370e394 commit aa8522f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/kotlin/city/newnan/violet/config/ConfigManager2.kt
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ class ConfigManager2
* @return [T] 实例
*/
@Throws(IOException::class, UnknownConfigFileFormatException::class)
fun <T> parse(path: File, type: ConfigFileType? = null): T {
inline fun <reified T> parse(path: File, type: ConfigFileType? = null): T {
// 读取配置文件
val typeReal = type ?: guessConfigType(path)
return mapper[typeReal].readValue(path, object : TypeReference<T>() {})
Expand All @@ -359,7 +359,7 @@ class ConfigManager2
* @return [T] 实例
*/
@Throws(JsonProcessingException::class, UnknownConfigFileFormatException::class)
fun <T> parse(config: String, type: ConfigFileType): T {
inline fun <reified T> parse(config: String, type: ConfigFileType): T {
return mapper[type].readValue(config, object : TypeReference<T>() {})
}

Expand Down Expand Up @@ -565,7 +565,7 @@ class ConfigManager2
* @return [T] 实例
*/
@Throws(IOException::class, UnknownConfigFileFormatException::class)
fun <T> parse(configFile: String, type: ConfigFileType? = null): T {
inline fun <reified T> parse(configFile: String, type: ConfigFileType? = null): T {
// 未缓存则加载
touch(configFile)
// 读取配置文件
Expand Down

0 comments on commit aa8522f

Please sign in to comment.