I'm learning Scala and trying to use javax.cache in Scala code and can't find how to solve this problem:
val cacheFactory = CacheManager.getInstance.getCacheFactory
val map = new HashMap
val cache = cacheFactory.createCache(map)
def rawSet(key:String, value:Array[Byte]) {
cache.put(key, value)
}
and the compiler error is:
error: type mismatch
found: String
required: K
in cache.put(key, value)
Edit:
As Daniel said, I should have mentioned in the question that I'm over app engine since that seems to be highly relevant. In this case, the solution is to create a small class in Java to do this particular code, and call it from Scala.