MutableSchemaBasedValueProcessor

zio.schema.MutableSchemaBasedValueProcessor
trait MutableSchemaBasedValueProcessor[Target, Context]

Base trait for mutable value processors, processing a value with a known schema. An example is protocol encoders.

The implementation is stack safe and consists of invocations of a series of processXYZ methods, as well as built-in support for a context value which is handled in a stacked way.

Maintaining any global state (per process) such as stream writers etc. is the responsibility of the implementation class.

The Target type parameter is the base type for the process function's output value. In case the process is built entirely using side effects (such as calls to a mutable writer interface) this type can be Unit.

The Context type parameter is the use-case specific context type which is passed for each process invocation, and can be manipulated before each process call achieving a local state.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Members list

Concise view

Value members

Abstract methods

protected def contextForEither(context: Context, e: Either[Unit, Unit]): Context

Gets the context for an either's left or right value within the parent context

Gets the context for an either's left or right value within the parent context

Attributes

protected def contextForEnumConstructor(context: Context, index: Int, c: Case[_, _]): Context

Gets the context for an enum's given constructor within the parent context

Gets the context for an enum's given constructor within the parent context

Attributes

protected def contextForMap(context: Context, schema: Map[_, _], index: Int): Context

Gets the context for a dictionary's given element within the parent context

Gets the context for a dictionary's given element within the parent context

Attributes

protected def contextForOption(context: Context, o: Option[Unit]): Context

Gets the context for an option's inner value within the parent context

Gets the context for an option's inner value within the parent context

Attributes

protected def contextForRecordField(context: Context, index: Int, field: Field[_, _]): Context

Gets the context for a record's given field within the parent context

Gets the context for a record's given field within the parent context

Attributes

protected def contextForSequence(context: Context, schema: Sequence[_, _, _], index: Int): Context

Gets the context for a sequence's given element within the parent context

Gets the context for a sequence's given element within the parent context

Attributes

protected def contextForSet(context: Context, schema: Set[_], index: Int): Context

Gets the context for a set's given element within the parent context

Gets the context for a set's given element within the parent context

Attributes

protected def contextForTuple(context: Context, index: Int): Context

Gets the context for a tuple's given field within the parent context

Gets the context for a tuple's given field within the parent context

Attributes

protected def fail(context: Context, message: String): Target

Fails the processing

Fails the processing

Attributes

protected def processDictionary(context: Context, schema: Map[_, _], value: Chunk[(Target, Target)]): Target
  • Process a dictionary using its already processed key-value pairs

Attributes

protected def processDynamic(context: Context, value: DynamicValue): Option[Target]

Process a dynamic value. If the result is None it indicates that the processor has no built-in support for dynamic values, and the Dynamic value's schema should be used instead.

Process a dynamic value. If the result is None it indicates that the processor has no built-in support for dynamic values, and the Dynamic value's schema should be used instead.

Attributes

protected def processEither(context: Context, schema: Either[_, _], value: Either[Target, Target]): Target

Process an either value using its already processed left or right value

Process an either value using its already processed left or right value

Attributes

protected def processEnum(context: Context, schema: Enum[_], tuple: (String, Target)): Target

Process an enum in the given context with the given schema using the processed constructor value and it's name

Process an enum in the given context with the given schema using the processed constructor value and it's name

Attributes

protected def processOption(context: Context, schema: Optional[_], value: Option[Target]): Target

Process an optional value using its already processed inner value, or None

Process an optional value using its already processed inner value, or None

Attributes

protected def processPrimitive(context: Context, value: Any, typ: StandardType[Any]): Target

Process a primitive value

Process a primitive value

Attributes

protected def processRecord(context: Context, schema: Record[_], value: ListMap[String, Target]): Target

Process a record in the given context with the given schema, using the already processed values of its fields.

Process a record in the given context with the given schema, using the already processed values of its fields.

Attributes

protected def processSequence(context: Context, schema: Sequence[_, _, _], value: Chunk[Target]): Target

Process a sequence using its already processed elements

Process a sequence using its already processed elements

Attributes

protected def processSet(context: Context, schema: Set[_], value: Set[Target]): Target

Process a set using its already processed elements

Process a set using its already processed elements

Attributes

protected def processTuple(context: Context, schema: Tuple2[_, _], left: Target, right: Target): Target

Process a tuple using its already processed left and right values

Process a tuple using its already processed left and right values

Attributes

Concrete methods

def process[A](schema: Schema[A], value: A): Target

Process a value based on it's schema

Process a value based on it's schema

Attributes

protected def startProcessingDictionary(context: Context, schema: Map[_, _], size: Int): Unit

Called before processing a dictionary

Called before processing a dictionary

Attributes

protected def startProcessingEither(context: Context, schema: Either[_, _]): Unit

Called before processing and either value

Called before processing and either value

Attributes

protected def startProcessingEnum(context: Context, schema: Enum[_]): Unit

Called before processing an enum

Called before processing an enum

Attributes

protected def startProcessingOption(context: Context, schema: Optional[_]): Unit

Called before processing an option value

Called before processing an option value

Attributes

protected def startProcessingRecord(context: Context, schema: Record[_]): Unit

Called before processing a record (before calling processXYZ for the record's fields)

Called before processing a record (before calling processXYZ for the record's fields)

Attributes

protected def startProcessingSequence(context: Context, schema: Sequence[_, _, _], size: Int): Unit

Called before processing a sequence

Called before processing a sequence

Attributes

protected def startProcessingSet(context: Context, schema: Set[_], size: Int): Unit

Called before processing a set

Called before processing a set

Attributes

protected def startProcessingTuple(context: Context, schema: Tuple2[_, _]): Unit

Called before processing a pair of values

Called before processing a pair of values

Attributes

Abstract fields

protected val initialContext: Context

The initial (top-level) context value

The initial (top-level) context value

Attributes