ObjectLens

class ObjectLens[U, Container](self: Lens[U, Container]) extends Lens[U, Container]

Represents a lens that has sub-lenses.

trait Lens[U, Container]
class Object
trait Matchable
class Any

Value members

Concrete methods

def field[A](lens: Lens[Container, A]): Lens[U, A]

Creates a sub-lens

Creates a sub-lens

def field[A](getter: Container => A)(setter: (Container, A) => Container): Lens[U, A]

Creates a sub-lens

Creates a sub-lens

override def get(u: U): Container
Definition Classes
override def set(c: Container): () => U
Definition Classes
def update(ms: Lens[Container, Container] => () => Container*): () => U

Inherited methods

def :=(a: Container): () => U

alias to set

alias to set

Inherited from
Lens
def compose[B](other: Lens[Container, B]): Lens[U, B]

Composes two lenses, this enables nesting.

Composes two lenses, this enables nesting.

If our field of type A has a sub-field of type B, then given a lens for it (other: Lens[A, B]) we can create a single lens from Container to B.

Inherited from
Lens
def modify(f: Container => Container): () => U

Represent an update operator (like x.y += 1 )

Represent an update operator (like x.y += 1 )

Inherited from
Lens
def setIfDefined(aOpt: Option[Container]): () => U

Optional assignment.

Optional assignment.

Given a Some[A], assign the Some's value to the field. Given None, the container is unchanged.

Inherited from
Lens
def zip[B](other: Lens[U, B]): Lens[U, (Container, B)]

Given two lenses with the same origin, returns a new lens that can mutate both values represented by both lenses through a tuple.

Given two lenses with the same origin, returns a new lens that can mutate both values represented by both lenses through a tuple.

Inherited from
Lens