DynamicValueMergeStrategy

zio.blocks.schema.DynamicValueMergeStrategy
See theDynamicValueMergeStrategy companion object

Strategy for merging two DynamicValue structures.

A DynamicValueMergeStrategy is a function (DynamicOptic, DynamicValue, DynamicValue) => DynamicValue that determines how to merge two DynamicValue values at a given path. The recurse method controls whether the merge driver should descend into containers (Record/Sequence/Map) or call apply directly.

When recurse returns true for a container type:

  • Records are merged by field name (union of fields, recursive merge on shared fields)
  • Sequences are merged by index (union of indices, recursive merge on shared indices)
  • Maps are merged by key (union of keys, recursive merge on shared keys)
  • Variants with same case name merge inner values; different cases: right wins

When recurse returns false, apply is called with the container values directly.

Attributes

Companion
object
Source
DynamicValueMergeStrategy.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Auto
object Concat
class Custom
object KeepLeft
object Replace
object Shallow
Show all

Members list

Value members

Abstract methods

def recurse(path: DynamicOptic, valueType: DynamicValueType): Boolean

Determines whether the merge driver should recurse into a container at the given path.

Determines whether the merge driver should recurse into a container at the given path.

If true, the driver merges by key (records/maps), by index (sequences), or by case (variants), recursively calling merge on each child pair.

If false, the driver calls apply with the container values directly.

Attributes

Source
DynamicValueMergeStrategy.scala

Inherited methods

Creates a curried version of this function.

Creates a curried version of this function.

Attributes

Returns

a function f such that f(x1)(x2)(x3) == apply(x1, x2, x3)

Inherited from:
Function3
Source
Function3.scala
override def toString(): String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Function3 -> Any
Inherited from:
Function3
Source
Function3.scala

Creates a tupled version of this function: instead of 3 arguments, it accepts a single scala.Tuple3 argument.

Creates a tupled version of this function: instead of 3 arguments, it accepts a single scala.Tuple3 argument.

Attributes

Returns

a function f such that f((x1, x2, x3)) == f(Tuple3(x1, x2, x3)) == apply(x1, x2, x3)

Inherited from:
Function3
Source
Function3.scala

Inherited and Abstract methods

Applies the body of this function to the arguments.

Applies the body of this function to the arguments.

Value parameters

v1

the 1st argument

v2

the 2nd argument

v3

the 3rd argument

Attributes

Returns

the result of function application.

Inherited from:
Function3
Source
Function3.scala