I used to develop on java, but now I stucked with one thing.
I have some kind of flexible value system.
trait Value[T] {
def get:T
}
I have implementations of this, for example
class StringValue(value : String) extends Value[String] {
override def get : String = value
}
class NumberValue(value : Int) extends Value[Int] {
override def get: Int = value
}
Then, I'm passing Value to Map, but I don't need parameter, as I don't know which implementation should be used.
case class Foo(attributes: Map[Attribute, Value)
On this step I get an error, because Value should have parameter.
I understand that it's might be fundamental difference between Java and Scala, so what should I use in this case?