PropMap

semagrams.PropMap
See thePropMap companion object
case class PropMap(pmap: Map[Property, Any])

A dependently-typed, persistent mapping from properties to values; the type of the value stored for a given property depends on the property.

We implement this internally with a Map from Property to Any, and then enforce that only things of the right property are used by only exposing well-typed insertion mappings.

Attributes

Companion:
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

Members list

Concise view

Value members

Concrete methods

def +[T](kv: (GenericProperty[T], T)): PropMap

Returns a new PropMap with kv(1) set to kv(2)

Returns a new PropMap with kv(1) set to kv(2)

Scala's type system doesn't have Sigma-types, so this only works with GenericProperty, not Property

Attributes

def ++(other: PropMap): PropMap

Returns a new PropMap given by overwriting this with the key-value pairs in other.

Returns a new PropMap given by overwriting this with the key-value pairs in other.

Attributes

def -(p: Property): PropMap

Unset p

Unset p

Attributes

def --(ps: IterableOnce[Property]): PropMap

Unset all of the properties in ps

Unset all of the properties in ps

Attributes

Fetch the value corresponding to p, throwing if p not found

Fetch the value corresponding to p, throwing if p not found

Attributes

def contains(p: Property): Boolean

Check if p is set

Check if p is set

Attributes

def get(p: Property): Option[Value]

Fetch the value corresponding to p, returning None if p not found

Fetch the value corresponding to p, returning None if p not found

Attributes

def set(k: Property, v: Value): PropMap

Returns a new PropMap with k set to v

Returns a new PropMap with k set to v

Attributes

def toJson(): Map[String, Value]

Use the serializers in the properties to write this out.

Use the serializers in the properties to write this out.

Attributes

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product