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

dev.mongocamp.driver.mongodb.relation.DefaultRelationCache.scala Maven / Gradle / Ivy

There is a newer version: 2.8.1
Show newest version
package dev.mongocamp.driver.mongodb.relation

import scala.collection.mutable

class DefaultRelationCache extends RelationCaching {
  val cachedRelations = new mutable.HashMap[String, AnyRef]()

  def addCachedValue(key: String, value: AnyRef): Unit =
    cachedRelations.+=(key -> value)

  def getCachedValue[B <: AnyRef](key: String): B =
    cachedRelations(key).asInstanceOf[B]

  def hasCachedValue(key: String): Boolean =
    cachedRelations.contains(key)

  def removeCachedValue(key: String): Unit =
    cachedRelations.remove(key)

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy