Skip to content

Commit

Permalink
Null support for set
Browse files Browse the repository at this point in the history
  • Loading branch information
mnbjhu committed Jan 29, 2023
1 parent c62395a commit ea5c2b4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/kotlin/uk/gibby/neo4k/clauses/Set.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ package uk.gibby.neo4k.clauses


import uk.gibby.neo4k.core.QueryScope
import uk.gibby.neo4k.returns.NotNull
import uk.gibby.neo4k.returns.ReturnValue
import uk.gibby.neo4k.returns.empty.EmptyReturnInstance
import uk.gibby.neo4k.returns.generic.Nullable

/**
* Delete
Expand Down Expand Up @@ -45,5 +47,6 @@ class Set(private val map: SetMap): Clause() {
class SetMap(internal val params: MutableMap<ReturnValue<*>, ReturnValue<*>> = mutableMapOf()){
infix fun <T, U: ReturnValue<T>>U.to(value: T) { params[this] = encode(value) }
infix fun <T, U: ReturnValue<T>>U.to(value: U) { params[this] = value }
infix fun <T: Any, U: NotNull<T>>Nullable<T, U>.to(value: U) { params[this] = value }
}
}

0 comments on commit ea5c2b4

Please sign in to comment.