mirror of
https://github.com/HighCapable/Gropify.git
synced 2025-12-11 15:53:54 +08:00
docs: update quick-start
This commit is contained in:
@@ -299,7 +299,12 @@ common {
|
|||||||
// These key-values rules are applied when properties' keys exist.
|
// These key-values rules are applied when properties' keys exist.
|
||||||
keyValuesRules(
|
keyValuesRules(
|
||||||
"some.key1" to ValueRule { if (it.contains("_")) it.replace("_", "-") else it },
|
"some.key1" to ValueRule { if (it.contains("_")) it.replace("_", "-") else it },
|
||||||
"some.key2" to ValueRule { "$it-value" }
|
"some.key2" to ValueRule { "$it-value" },
|
||||||
|
// You can also specify the expected type class,
|
||||||
|
// the type you specify will be used during generation,
|
||||||
|
// and an exception will be thrown if the type cannot be converted correctly.
|
||||||
|
// If the [useTypeAutoConversion] is not enabled, this parameter will be ignored.
|
||||||
|
"some.key3" to ValueRule(Int::class)
|
||||||
)
|
)
|
||||||
|
|
||||||
// Set where to find properties' key-values.
|
// Set where to find properties' key-values.
|
||||||
|
|||||||
@@ -283,7 +283,11 @@ common {
|
|||||||
// 当属性键存在时应用这些键值规则
|
// 当属性键存在时应用这些键值规则
|
||||||
keyValuesRules(
|
keyValuesRules(
|
||||||
"some.key1" to ValueRule { if (it.contains("_")) it.replace("_", "-") else it },
|
"some.key1" to ValueRule { if (it.contains("_")) it.replace("_", "-") else it },
|
||||||
"some.key2" to ValueRule { "$it-value" }
|
"some.key2" to ValueRule { "$it-value" },
|
||||||
|
// 你还可以指定期望的类型类,生成时将使用你指定的类型,
|
||||||
|
// 如果类型无法正确转换,将抛出异常
|
||||||
|
// 如果未启用 [useTypeAutoConversion],此参数将被忽略
|
||||||
|
"some.key3" to ValueRule(Int::class)
|
||||||
)
|
)
|
||||||
|
|
||||||
// 设置查找属性键值的位置
|
// 设置查找属性键值的位置
|
||||||
|
|||||||
Reference in New Issue
Block a user