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

org.powerscala.property.backing.MapPropertyBacking.scala Maven / Gradle / Ivy

The newest version!
package org.powerscala.property.backing

import org.powerscala.property.Property

/**
 * @author Matt Hicks 
 */
class MapPropertyBacking[T](key: String, mapProperty: Property[Map[String, Any]]) extends Backing[Option[T]] {
  def getValue = mapProperty().get(key).asInstanceOf[Option[T]]

  def setValue(value: Option[T]) = mapProperty.synchronized {
    mapProperty := mapProperty() + (key -> value)
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy