Skip to content

Commit

Permalink
fix: fix bug in dsl in/not in extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
Idane committed Jul 14, 2022
1 parent a89b4ae commit 5de093d
Showing 1 changed file with 26 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ class FilterFieldsBuilder<RootType : PersistentEntity>(private val filterFields:
}

@JvmName("stringRequireIn")
infix fun KProperty1<RootType, Collection<String>>.RequireIn(target: Collection<String>) {
infix fun KProperty1<RootType, String>.RequireIn(target: Collection<String>) {
if (target.isEmpty()) {
noop()
} else {
Expand All @@ -155,7 +155,7 @@ class FilterFieldsBuilder<RootType : PersistentEntity>(private val filterFields:
}

@JvmName("intRequireIn")
infix fun KProperty1<RootType, Collection<Int>>.RequireIn(target: Collection<Int>) {
infix fun KProperty1<RootType, Int>.RequireIn(target: Collection<Int>) {
if (target.isEmpty()) {
noop()
} else {
Expand All @@ -164,7 +164,7 @@ class FilterFieldsBuilder<RootType : PersistentEntity>(private val filterFields:
}

@JvmName("longRequireIn")
infix fun KProperty1<RootType, Collection<Long>>.RequireIn(target: Collection<Long>) {
infix fun KProperty1<RootType, Long>.RequireIn(target: Collection<Long>) {
if (target.isEmpty()) {
noop()
} else {
Expand All @@ -173,7 +173,7 @@ class FilterFieldsBuilder<RootType : PersistentEntity>(private val filterFields:
}

@JvmName("doubleRequireIn")
infix fun KProperty1<RootType, Collection<Double>>.RequireIn(target: Collection<Double>) {
infix fun KProperty1<RootType, Double>.RequireIn(target: Collection<Double>) {
if (target.isEmpty()) {
noop()
} else {
Expand All @@ -182,7 +182,7 @@ class FilterFieldsBuilder<RootType : PersistentEntity>(private val filterFields:
}

@JvmName("dateRequireIn")
infix fun KProperty1<RootType, Collection<Date>>.RequireIn(target: Collection<Date>) {
infix fun KProperty1<RootType, Date>.RequireIn(target: Collection<Date>) {
if (target.isEmpty()) {
noop()
} else {
Expand All @@ -191,7 +191,7 @@ class FilterFieldsBuilder<RootType : PersistentEntity>(private val filterFields:
}

@JvmName("enumRequireIn")
infix fun <EnumType : Enum<EnumType>> KProperty1<RootType, Collection<EnumType>>.RequireIn(target: Collection<EnumType>) {
infix fun <EnumType : Enum<EnumType>> KProperty1<RootType, EnumType>.RequireIn(target: Collection<EnumType>) {
if (target.isEmpty()) {
noop()
} else {
Expand All @@ -200,7 +200,7 @@ class FilterFieldsBuilder<RootType : PersistentEntity>(private val filterFields:
}

@JvmName("stringRequireNotIn")
infix fun KProperty1<RootType, Collection<String>>.RequireNotIn(target: Collection<String>) {
infix fun KProperty1<RootType, String>.RequireNotIn(target: Collection<String>) {
if (target.isEmpty()) {
noop()
} else {
Expand All @@ -209,7 +209,7 @@ class FilterFieldsBuilder<RootType : PersistentEntity>(private val filterFields:
}

@JvmName("intRequireNotIn")
infix fun KProperty1<RootType, Collection<Int>>.RequireNotIn(target: Collection<Int>) {
infix fun KProperty1<RootType, Int>.RequireNotIn(target: Collection<Int>) {
if (target.isEmpty()) {
noop()
} else {
Expand All @@ -218,7 +218,7 @@ class FilterFieldsBuilder<RootType : PersistentEntity>(private val filterFields:
}

@JvmName("longRequireNotIn")
infix fun KProperty1<RootType, Collection<Long>>.RequireNotIn(target: Collection<Long>) {
infix fun KProperty1<RootType, Long>.RequireNotIn(target: Collection<Long>) {
if (target.isEmpty()) {
noop()
} else {
Expand All @@ -227,7 +227,7 @@ class FilterFieldsBuilder<RootType : PersistentEntity>(private val filterFields:
}

@JvmName("doubleRequireNotIn")
infix fun KProperty1<RootType, Collection<Double>>.RequireNotIn(target: Collection<Double>) {
infix fun KProperty1<RootType, Double>.RequireNotIn(target: Collection<Double>) {
if (target.isEmpty()) {
noop()
} else {
Expand All @@ -236,7 +236,7 @@ class FilterFieldsBuilder<RootType : PersistentEntity>(private val filterFields:
}

@JvmName("dateRequireNotIn")
infix fun KProperty1<RootType, Collection<Date>>.RequireNotIn(target: Collection<Date>) {
infix fun KProperty1<RootType, Date>.RequireNotIn(target: Collection<Date>) {
if (target.isEmpty()) {
noop()
} else {
Expand All @@ -245,7 +245,7 @@ class FilterFieldsBuilder<RootType : PersistentEntity>(private val filterFields:
}

@JvmName("enumRequireNotIn")
infix fun <EnumType : Enum<EnumType>> KProperty1<RootType, Collection<EnumType>>.RequireNotIn(target: Collection<EnumType>) {
infix fun <EnumType : Enum<EnumType>> KProperty1<RootType, EnumType>.RequireNotIn(target: Collection<EnumType>) {
if (target.isEmpty()) {
noop()
} else {
Expand All @@ -254,72 +254,72 @@ class FilterFieldsBuilder<RootType : PersistentEntity>(private val filterFields:
}

@JvmName("stringIn")
infix fun KProperty1<RootType, Collection<String>>.In(target: Collection<String>) {
infix fun KProperty1<RootType, String>.In(target: Collection<String>) {
filterFields += FilterField(effectiveName, FilterFieldOperation.In, FilterFieldDataType.String, *target.toTypedArray())
}

@JvmName("intIn")
infix fun KProperty1<RootType, Collection<Int>>.In(target: Collection<Int>) {
infix fun KProperty1<RootType, Int>.In(target: Collection<Int>) {
filterFields += FilterField(effectiveName, FilterFieldOperation.In, FilterFieldDataType.Integer, *target.toTypedArray())
}

@JvmName("longIn")
infix fun KProperty1<RootType, Collection<Long>>.In(target: Collection<Long>) {
infix fun KProperty1<RootType, Long>.In(target: Collection<Long>) {
filterFields += FilterField(effectiveName, FilterFieldOperation.In, FilterFieldDataType.Long, *target.toTypedArray())
}

@JvmName("doubleIn")
infix fun KProperty1<RootType, Collection<Double>>.In(target: Collection<Double>) {
infix fun KProperty1<RootType, Double>.In(target: Collection<Double>) {
filterFields += FilterField(effectiveName, FilterFieldOperation.In, FilterFieldDataType.Double, *target.toTypedArray())
}

@JvmName("dateIn")
infix fun KProperty1<RootType, Collection<Date>>.In(target: Collection<Date>) {
infix fun KProperty1<RootType, Date>.In(target: Collection<Date>) {
filterFields += FilterField(effectiveName, FilterFieldOperation.In, FilterFieldDataType.Date, *target.toTypedArray())
}

@JvmName("enumIn")
infix fun <EnumType : Enum<EnumType>> KProperty1<RootType, Collection<EnumType>>.In(target: Collection<EnumType>) {
infix fun <EnumType : Enum<EnumType>> KProperty1<RootType, EnumType>.In(target: Collection<EnumType>) {
filterFields += FilterField(effectiveName, FilterFieldOperation.In, target.first()::class.java.canonicalName, *(target as Collection<*>).toTypedArray())
}

@JvmName("stringNotIn")
infix fun KProperty1<RootType, Collection<String>>.NotIn(target: Collection<String>) {
infix fun KProperty1<RootType, String>.NotIn(target: Collection<String>) {
filterFields += FilterField(effectiveName, FilterFieldOperation.NotIn, FilterFieldDataType.String, *target.toTypedArray())
}

@JvmName("intNotIn")
infix fun KProperty1<RootType, Collection<Int>>.NotIn(target: Collection<Int>) {
infix fun KProperty1<RootType, Int>.NotIn(target: Collection<Int>) {
filterFields += FilterField(effectiveName, FilterFieldOperation.NotIn, FilterFieldDataType.Integer, *target.toTypedArray())
}

@JvmName("longNotIn")
infix fun KProperty1<RootType, Collection<Long>>.NotIn(target: Collection<Long>) {
infix fun KProperty1<RootType, Long>.NotIn(target: Collection<Long>) {
filterFields += FilterField(effectiveName, FilterFieldOperation.NotIn, FilterFieldDataType.Long, *target.toTypedArray())
}

@JvmName("doubleNotIn")
infix fun KProperty1<RootType, Collection<Double>>.NotIn(target: Collection<Double>) {
infix fun KProperty1<RootType, Double>.NotIn(target: Collection<Double>) {
filterFields += FilterField(effectiveName, FilterFieldOperation.NotIn, FilterFieldDataType.Double, *target.toTypedArray())
}

@JvmName("dateNotIn")
infix fun KProperty1<RootType, Collection<Date>>.NotIn(target: Collection<Date>) {
infix fun KProperty1<RootType, Date>.NotIn(target: Collection<Date>) {
filterFields += FilterField(effectiveName, FilterFieldOperation.NotIn, FilterFieldDataType.Date, *target.toTypedArray())
}

@JvmName("enumNotIn")
infix fun <EnumType : Enum<EnumType>> KProperty1<RootType, Collection<EnumType>>.NotIn(target: Collection<EnumType>) {
infix fun <EnumType : Enum<EnumType>> KProperty1<RootType, EnumType>.NotIn(target: Collection<EnumType>) {
filterFields += FilterField(effectiveName, FilterFieldOperation.NotIn, target.first()::class.java.canonicalName, *(target as Collection<*>).toTypedArray())
}

@JvmName("stringContainsIn")
infix fun KProperty1<RootType, Collection<String>>.ContainsIn(target: Collection<String>) {
infix fun KProperty1<RootType, String>.ContainsIn(target: Collection<String>) {
filterFields += FilterField(effectiveName, FilterFieldOperation.ContainsIn, FilterFieldDataType.String, *(target as Collection<*>).toTypedArray())
}

@JvmName("stringNotContainsIn")
infix fun KProperty1<RootType, Collection<String>>.NotContainsIn(target: Collection<String>) {
infix fun KProperty1<RootType, String>.NotContainsIn(target: Collection<String>) {
filterFields += FilterField(effectiveName, FilterFieldOperation.NotContainsIn, FilterFieldDataType.String, *(target as Collection<*>).toTypedArray())
}

Expand Down

0 comments on commit 5de093d

Please sign in to comment.