-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
09f3554
commit 3a6cbf5
Showing
7 changed files
with
71 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
project/module-item/src/main/kotlin/cn/fd/ratziel/module/item/api/common/ArgumentResolver.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package cn.fd.ratziel.module.item.api.common | ||
|
||
import cn.fd.ratziel.function.argument.ArgumentFactory | ||
import cn.fd.ratziel.function.argument.DefaultArgumentFactory | ||
import cn.fd.ratziel.module.item.api.Resolver | ||
|
||
/** | ||
* ArgumentResolver | ||
* | ||
* @author TheFloodDragon | ||
* @since 2024/5/21 22:54 | ||
*/ | ||
interface ArgumentResolver<E, T> : Resolver<E, T> { | ||
|
||
/** | ||
* 解析元素 (带参数) | ||
*/ | ||
fun resolve(element: E, arguments: ArgumentFactory): T | ||
|
||
/** | ||
* 解析元素 (带空参数) | ||
*/ | ||
override fun resolve(element: E): T = resolve(element, DefaultArgumentFactory()) | ||
|
||
} |
21 changes: 21 additions & 0 deletions
21
...t/module-item/src/main/kotlin/cn/fd/ratziel/module/item/api/common/NamedStringResolver.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package cn.fd.ratziel.module.item.api.common | ||
|
||
/** | ||
* NamedStringResolver | ||
* | ||
* @author TheFloodDragon | ||
* @since 2024/5/21 22:55 | ||
*/ | ||
interface NamedStringResolver : StringResolver { | ||
|
||
/** | ||
* 解析器名称 | ||
*/ | ||
val name: String | ||
|
||
/** | ||
* 解析器别名 | ||
*/ | ||
val alias: Array<String> | ||
|
||
} |
28 changes: 1 addition & 27 deletions
28
project/module-item/src/main/kotlin/cn/fd/ratziel/module/item/api/common/StringResolver.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,9 @@ | ||
package cn.fd.ratziel.module.item.api.common | ||
|
||
import cn.fd.ratziel.function.argument.ArgumentFactory | ||
import cn.fd.ratziel.function.argument.DefaultArgumentFactory | ||
import cn.fd.ratziel.module.item.api.Resolver | ||
|
||
/** | ||
* StringResolver | ||
* | ||
* @author TheFloodDragon | ||
* @since 2024/5/18 15:15 | ||
*/ | ||
interface StringResolver : Resolver<Iterable<String>, String?> { | ||
|
||
/** | ||
* 解析器名称 | ||
*/ | ||
val name: String | ||
|
||
/** | ||
* 解析器别名 | ||
*/ | ||
val alias: Array<String> | ||
|
||
/** | ||
* 解析元素 (带参数) | ||
*/ | ||
fun resolve(element: Iterable<String>, arguments: ArgumentFactory): String? | ||
|
||
/** | ||
* 解析元素 (带空参数) | ||
*/ | ||
override fun resolve(element: Iterable<String>): String? = resolve(element, DefaultArgumentFactory()) | ||
|
||
} | ||
interface StringResolver : ArgumentResolver<Iterable<String>, String?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters