All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.squareup.sqldelight.internal.QueryList.kt Maven / Gradle / Ivy

The newest version!
package com.squareup.sqldelight.internal

import com.squareup.sqldelight.Query

/**
 * TODO: Get rid of if CopyOnWriteArrayList joins kotlin.collections?
 */
class QueryList {
  internal var queries: List> = emptyList()

  fun addQuery(query: Query<*>) {
    synchronized(queries) {
      queries += query
    }
  }

  fun removeQuery(query: Query<*>) {
    synchronized(queries) {
      queries -= query
    }
  }

  operator fun plus(other: QueryList): QueryList {
    val result = QueryList()
    result.queries = queries + other.queries
    return result
  }
}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy