SimpleMutableSchemaBasedValueBuilder

zio.schema.SimpleMutableSchemaBasedValueBuilder

A simpler version of SimpleMutableSchemaBasedValueBuilder without using any Context

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

protected def createDictionary(schema: Map[_, _], values: Chunk[(Target, Target)]): Target
protected def createDynamic(): Option[Target]
protected def createEither(schema: Either[_, _], value: Either[Target, Target]): Target
protected def createEnum(cases: Chunk[Case[_, _]], index: Int, value: Target): Target
protected def createFallback(schema: Fallback[_, _], value: Fallback[Target, Target]): Target
protected def createOptional(schema: Optional[_], value: Option[Target]): Target
protected def createPrimitive(typ: StandardType[_]): Target
protected def createRecord(record: Record[_], values: Chunk[(Int, Target)]): Target
protected def createSequence(schema: Sequence[_, _, _], values: Chunk[Target]): Target
protected def createSet(schema: Set[_], values: Chunk[Target]): Target
protected def createTuple(schema: Tuple2[_, _], left: Target, right: Target): Target
protected def fail(message: String): Target
protected def startCreatingDictionary(schema: Map[_, _]): Option[Unit]
protected def startCreatingEither(schema: Either[_, _]): Either[Unit, Unit]
protected def startCreatingEnum(cases: Chunk[Case[_, _]]): Int
protected def startCreatingFallback(schema: Fallback[_, _]): Fallback[Unit, Unit]
protected def startCreatingOptional(schema: Optional[_]): Option[Unit]
protected def startCreatingRecord(record: Record[_]): Unit
protected def startCreatingSequence(schema: Sequence[_, _, _]): Option[Unit]
protected def startCreatingSet(schema: Set[_]): Option[Unit]
protected def startCreatingTuple(schema: Tuple2[_, _]): Unit
protected def startReadingField(record: Record[_], index: Int): Option[Int]
protected def startReadingOneDictionaryKey(schema: Map[_, _]): Unit
protected def startReadingOneDictionaryValue(schema: Map[_, _]): Unit
protected def startReadingOneSequenceElement(schema: Sequence[_, _, _]): Unit
protected def startReadingOneSetElement(schema: Set[_]): Unit
protected def startReadingRightFallback(schema: Fallback[_, _]): Unit
protected def startReadingSecondTupleElement(schema: Tuple2[_, _]): Unit
protected def transform(value: Target, f: Any => Either[String, Any], schema: Schema[_]): Target

Concrete methods

override protected def createDictionary(context: Unit, schema: Map[_, _], values: Chunk[(Target, Target)]): Target

Creates the dictionary value from the chunk of key-value pairs

Creates the dictionary value from the chunk of key-value pairs

Attributes

Definition Classes
override protected def createDynamic(context: Unit): Option[Target]

Creates a Dynamic value. If the returned value is None, it indicates that the builder does not have any built-in support for Dynamic values, and it will be built using Dynamic's schema.

Creates a Dynamic value. If the returned value is None, it indicates that the builder does not have any built-in support for Dynamic values, and it will be built using Dynamic's schema.

Attributes

Definition Classes
override protected def createEither(context: Unit, schema: Either[_, _], value: Either[Target, Target]): Target

Create the either value from an inner value

Create the either value from an inner value

Attributes

Definition Classes
override protected def createEnum(context: Unit, cases: Chunk[Case[_, _]], index: Int, value: Target): Target

Creates an enum value from the read constructor value

Creates an enum value from the read constructor value

Attributes

Definition Classes
override protected def createFallback(context: Unit, schema: Fallback[_, _], value: Fallback[Target, Target]): Target

Create the fallback value from an inner value

Create the fallback value from an inner value

Attributes

Definition Classes
override protected def createOptional(context: Unit, schema: Optional[_], value: Option[Target]): Target

Creates the optional value from the inner value

Creates the optional value from the inner value

Attributes

Definition Classes
override protected def createPrimitive(context: Unit, typ: StandardType[_]): Target

Creates a primitive value of the given standard type

Creates a primitive value of the given standard type

Attributes

Definition Classes
override protected def createRecord(context: Unit, record: Record[_], values: Chunk[(Int, Target)]): Target

Creates a record value from the gathered field values

Creates a record value from the gathered field values

Attributes

Definition Classes
override protected def createSequence(context: Unit, schema: Sequence[_, _, _], values: Chunk[Target]): Target

Creates the sequence value from the chunk of element values

Creates the sequence value from the chunk of element values

Attributes

Definition Classes
override protected def createSet(context: Unit, schema: Set[_], values: Chunk[Target]): Target

Creates the set value from the chunk of element values

Creates the set value from the chunk of element values

Attributes

Definition Classes
override protected def createTuple(context: Unit, schema: Tuple2[_, _], left: Target, right: Target): Target

Creates the tuple from the constructed first and second values

Creates the tuple from the constructed first and second values

Attributes

Definition Classes
override protected def fail(context: Unit, message: String): Target

Fail the builder with the given message

Fail the builder with the given message

Attributes

Definition Classes
override protected def startCreatingDictionary(context: Unit, schema: Map[_, _]): Option[Unit]

The next value to build is a dictionary. If the returned value is None, the builder creates an empty dictionary, otherwise it calls startCreatingOneDictionaryElement, startCreatingOneDictionaryValue and finishedCreatingOneDictionaryElement for each element with the returned context.

The next value to build is a dictionary. If the returned value is None, the builder creates an empty dictionary, otherwise it calls startCreatingOneDictionaryElement, startCreatingOneDictionaryValue and finishedCreatingOneDictionaryElement for each element with the returned context.

Attributes

Definition Classes
override protected def startCreatingEither(context: Unit, schema: Either[_, _]): Either[Unit, Unit]

The next value to be created is an either value with the given schema. Similarly to optional values, this method is responsible for gathering enough information to decide whether the created value will be a Left or a Right. The result value represents this, and for each case allows specifying a context that will be used to create the inner value.

The next value to be created is an either value with the given schema. Similarly to optional values, this method is responsible for gathering enough information to decide whether the created value will be a Left or a Right. The result value represents this, and for each case allows specifying a context that will be used to create the inner value.

Attributes

Definition Classes
override protected def startCreatingEnum(context: Unit, cases: Chunk[Case[_, _]]): (Unit, Int)

The next value to build is an enum with the given schema

The next value to build is an enum with the given schema

Attributes

Definition Classes
override protected def startCreatingFallback(context: Unit, schema: Fallback[_, _]): Fallback[Unit, Unit]

The next value to be created is a fallback value with the given Fallback schema. Similarly to optional values, this method is responsible for gathering enough information to decide whether the created value will be a Left, a Right or a Both. The result value represents this, and for each case allows specifying a context that will be used to create the inner value.

The next value to be created is a fallback value with the given Fallback schema. Similarly to optional values, this method is responsible for gathering enough information to decide whether the created value will be a Left, a Right or a Both. The result value represents this, and for each case allows specifying a context that will be used to create the inner value.

Attributes

Definition Classes
override protected def startCreatingOneDictionaryElement(state: Unit, schema: Map[_, _]): Unit

Called before constructing a next dictionary element. The returned context is used for constructing that single element's key.

Called before constructing a next dictionary element. The returned context is used for constructing that single element's key.

Attributes

Definition Classes
override protected def startCreatingOneDictionaryValue(state: Unit, schema: Map[_, _]): Unit

Called after the key of a single element was created, before the value gets created. The returned context is for constructing the element's value part.

Called after the key of a single element was created, before the value gets created. The returned context is for constructing the element's value part.

Attributes

Definition Classes
override protected def startCreatingOneSequenceElement(state: Unit, schema: Sequence[_, _, _]): Unit

Called before constructing a next sequence element. The returned context is used for constructing that single element.

Called before constructing a next sequence element. The returned context is used for constructing that single element.

Attributes

Definition Classes
override protected def startCreatingOneSetElement(state: Unit, schema: Set[_]): Unit

Called before constructing a next set element. The returned context is used for constructing that single element.

Called before constructing a next set element. The returned context is used for constructing that single element.

Attributes

Definition Classes
override protected def startCreatingOptional(context: Unit, schema: Optional[_]): Option[Unit]

The next value to be created is an optional value. If the result is None, the optional value created will be None. If it is a context, that context will be used to create the optional value.

The next value to be created is an optional value. If the result is None, the optional value created will be None. If it is a context, that context will be used to create the optional value.

Attributes

Definition Classes
override protected def startCreatingRecord(context: Unit, record: Record[_]): Unit

The next value to build is a record with the given schema

The next value to build is a record with the given schema

Attributes

Definition Classes
override protected def startCreatingSequence(context: Unit, schema: Sequence[_, _, _]): Option[Unit]

The next value to build is a sequence. If the returned value is None, the builder creates an empty sequence, otherwise it calls startCreatingOneSequenceElement and finishedCreatingOneSequenceElement for each element with the returned context.

The next value to build is a sequence. If the returned value is None, the builder creates an empty sequence, otherwise it calls startCreatingOneSequenceElement and finishedCreatingOneSequenceElement for each element with the returned context.

Attributes

Definition Classes
override protected def startCreatingSet(context: Unit, schema: Set[_]): Option[Unit]

The next value to build is a set. If the returned value is None, the builder creates an empty set, otherwise it calls startCreatingOneSetElement and finishedCreatingOneSetElement for each element with the returned context.

The next value to build is a set. If the returned value is None, the builder creates an empty set, otherwise it calls startCreatingOneSetElement and finishedCreatingOneSetElement for each element with the returned context.

Attributes

Definition Classes
override protected def startCreatingTuple(context: Unit, schema: Tuple2[_, _]): Unit

The next value to be created is a tuple with the given schema. The returned context is used to construct the first element of the tuple.

The next value to be created is a tuple with the given schema. The returned context is used to construct the first element of the tuple.

Attributes

Definition Classes
override protected def startReadingField(context: Unit, record: Record[_], index: Int): ReadingFieldResult[Unit]

Called for each field of a record. The result is either Finished indicating there are no more fields to read, or it contains an updated context belonging to the field and the next field's index in the schema. This allows the implementation to instantiate fields in a different order than what the schema defines. A third option is to just update the context without reading any field - this can be used to skip data, for example when reading a newer format of a record that has more fields than the older one.

Called for each field of a record. The result is either Finished indicating there are no more fields to read, or it contains an updated context belonging to the field and the next field's index in the schema. This allows the implementation to instantiate fields in a different order than what the schema defines. A third option is to just update the context without reading any field - this can be used to skip data, for example when reading a newer format of a record that has more fields than the older one.

The index parameter is a 0-based index, incremented by one for each field read within a record.

Attributes

Definition Classes
override protected def startReadingRightFallback(context: Unit, schema: Fallback[_, _]): Unit

Called for reading right element of a Fallback.Both

Called for reading right element of a Fallback.Both

Attributes

Definition Classes
override protected def startReadingSecondTupleElement(context: Unit, schema: Tuple2[_, _]): Unit

Called after finished constructing the first element, before constructing the second. The returned context is used to construct the second value.

Called after finished constructing the first element, before constructing the second. The returned context is used to construct the second value.

Attributes

Definition Classes
override protected def transform(context: Unit, value: Target, f: Any => Either[String, Any], schema: Schema[_]): Target

Transforms a value with the given function that can fail. Making this customizable allows encoding the failure in Target.

Transforms a value with the given function that can fail. Making this customizable allows encoding the failure in Target.

Attributes

Definition Classes

Inherited methods

def create[A](schema: Schema[A]): Target

Create a value of type A with the provided schema using this builder

Create a value of type A with the provided schema using this builder

Attributes

Inherited from:
MutableSchemaBasedValueBuilder

Concrete fields

override protected val initialContext: Unit

The initial (top-level) context value

The initial (top-level) context value

Attributes