Skip to content

Commit

Permalink
Small bugfix on Filter
Browse files Browse the repository at this point in the history
  • Loading branch information
Daeda88 committed Nov 17, 2024
1 parent 2262309 commit aceb6c1
Showing 1 changed file with 18 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,41 +15,49 @@ public sealed interface WhereConstraint {
public sealed interface ForObject : WhereConstraint {
public val value: Any
}

public sealed interface ForArray : WhereConstraint {
public val values: List<Any>
}

public data class EqualTo @PublishedApi internal constructor(private val valueBuilder: () -> Any?) : ForNullableObject {
override val value: Any? = valueBuilder()
override val value: Any? get() = valueBuilder()
}

public data class NotEqualTo @PublishedApi internal constructor(private val valueBuilder: () -> Any?) : ForNullableObject {
override val value: Any? = valueBuilder()
override val value: Any? get() = valueBuilder()
}

public data class LessThan @PublishedApi internal constructor(private val valueBuilder: () -> Any) : ForObject {
override val value: Any = valueBuilder()
override val value: Any get() = valueBuilder()
}

public data class GreaterThan @PublishedApi internal constructor(private val valueBuilder: () -> Any) : ForObject {
override val value: Any = valueBuilder()
override val value: Any get() = valueBuilder()
}

public data class LessThanOrEqualTo @PublishedApi internal constructor(private val valueBuilder: () -> Any) : ForObject {
override val value: Any = valueBuilder()
override val value: Any get() = valueBuilder()
}

public data class GreaterThanOrEqualTo @PublishedApi internal constructor(private val valueBuilder: () -> Any) : ForObject {
override val value: Any = valueBuilder()
override val value: Any get() = valueBuilder()
}

public data class ArrayContains @PublishedApi internal constructor(private val valueBuilder: () -> Any) : ForObject {
override val value: Any = valueBuilder()
override val value: Any get() = valueBuilder()
}

public data class ArrayContainsAny @PublishedApi internal constructor(private val valueBuilders: List<() -> Any>) : ForArray {
override val values: List<Any> = valueBuilders.map { it.invoke() }
override val values: List<Any> get() = valueBuilders.map { it.invoke() }
}

public data class InArray @PublishedApi internal constructor(private val valueBuilders: List<() -> Any>) : ForArray {
override val values: List<Any> = valueBuilders.map { it.invoke() }
override val values: List<Any> get() = valueBuilders.map { it.invoke() }
}

public data class NotInArray @PublishedApi internal constructor(private val valueBuilders: List<() -> Any>) : ForArray {
override val values: List<Any> = valueBuilders.map { it.invoke() }
override val values: List<Any> get() = valueBuilders.map { it.invoke() }
}
}

Expand Down

0 comments on commit aceb6c1

Please sign in to comment.