Skip to content

Commit 2498405

Browse files
committed
Add libName and libType to Rule data class
The Rule data class now includes libName and libType fields. LCRules has been updated to provide these values when creating Rule instances, ensuring more complete rule information is available.
1 parent cdcce16 commit 2498405

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

library/src/main/java/com/absinthe/rulesbundle/LCRules.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ object LCRules : IAPI {
5858
val entity = repo.getRule(libName, type)
5959
if (entity != null) {
6060
return Rule(
61+
libName,
62+
type,
6163
entity.label,
6264
IconResMap.getIconRes(entity.iconIndex),
6365
getDescriptionUrl(entity),
@@ -70,6 +72,8 @@ object LCRules : IAPI {
7072
val match = regexMap.entries.firstOrNull { it.key.matcher(libName).matches() && it.value.type == type }
7173
match?.value?.let {
7274
return Rule(
75+
libName,
76+
type,
7377
it.label,
7478
IconResMap.getIconRes(it.iconIndex),
7579
getDescriptionUrl(it),

library/src/main/java/com/absinthe/rulesbundle/Rule.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import kotlinx.parcelize.Parcelize
66

77
@Parcelize
88
data class Rule(
9+
val libName: String,
10+
@LibType val libType: Int,
911
val label: String,
1012
@DrawableRes val iconRes: Int,
1113
val descriptionUrl: String?,

0 commit comments

Comments
 (0)