add missing Attributed.get method

This commit is contained in:
Mark Harrah 2011-06-29 21:44:37 -04:00
parent 9578ed3db0
commit c25c92da40
1 changed files with 1 additions and 0 deletions

View File

@ -97,6 +97,7 @@ final case class AttributeEntry[T](key: AttributeKey[T], value: T)
final case class Attributed[D](data: D)(val metadata: AttributeMap)
{
def get[T](key: AttributeKey[T]): Option[T] = metadata.get(key)
def put[T](key: AttributeKey[T], value: T): Attributed[D] = Attributed(data)(metadata.put(key, value))
def map[T](f: D => T): Attributed[T] = Attributed(f(data))(metadata)
}