Either

zio.schema.Schema.Either
final case class Either[A, B](left: Schema[A], right: Schema[B], annotations: Chunk[Any] = ...) extends Schema[Either[A, B]]

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Schema[Either[A, B]]
class Object
trait Matchable
class Any
Show all
Self type
Either[A, B]

Members list

Type members

Types

override type Accessors[Lens[_, _, _], Prism[_, _, _], Traversal[_, _]] = (Prism[rightSingleton.type, Either[A, B], Right[Nothing, B]], Prism[leftSingleton.type, Either[A, B], Left[A, Nothing]])
type LeftType = A
type RightType = B

Value members

Concrete methods

override def annotate(annotation: Any): Either[A, B]

Returns a new schema that with annotation

Returns a new schema that with annotation

Attributes

Definition Classes
override def defaultValue: Either[String, Either[A, B]]

The default value for a Schema of type A.

The default value for a Schema of type A.

Attributes

Definition Classes
override def makeAccessors(b: AccessorBuilder): (b.Prism[rightSingleton.type, Either[A, B], Right[Nothing, B]], b.Prism[leftSingleton.type, Either[A, B], Left[A, Nothing]])

Attributes

Definition Classes

Inherited methods

def <*>[B](that: Schema[B]): Schema[(Either[A, B], B)]

A symbolic operator for zip.

A symbolic operator for zip.

Attributes

Inherited from:
Schema
def <+>[B](that: Schema[B]): Schema[Either[Either[A, B], B]]

A symbolic operator for orElseEither.

A symbolic operator for orElseEither.

Attributes

Inherited from:
Schema
def ?: Schema[Option[Either[A, B]]]

A symbolic operator for optional.

A symbolic operator for optional.

Attributes

Inherited from:
Schema

Attributes

Inherited from:
Schema
def coerce[B](newSchema: Schema[B]): Either[String, Schema[B]]

Convert to Schema[B] iff B and A are homomorphic.

Convert to Schema[B] iff B and A are homomorphic.

This can be used to e.g convert between a case class and it's "generic" representation as a ListMap[String,_]

Attributes

Inherited from:
Schema
def default(value: Either[A, B]): Schema[Either[A, B]]

Add a default value to this schema.

Add a default value to this schema.

Attributes

Inherited from:
Schema
def diff(thisValue: Either[A, B], thatValue: Either[A, B]): Patch[Either[A, B]]

Performs a diff between thisValue and thatValue. See zio.schema.Differ for details on the default diff algorithms.

Performs a diff between thisValue and thatValue. See zio.schema.Differ for details on the default diff algorithms.

Attributes

Inherited from:
Schema

Attributes

Inherited from:
Schema
def migrate[B](newSchema: Schema[B]): Either[String, Either[A, B] => Either[String, B]]

Generate a homomorphism from A to B iff A and B are homomorphic

Generate a homomorphism from A to B iff A and B are homomorphic

Attributes

Inherited from:
Schema
def optional: Schema[Option[Either[A, B]]]

Returns a new schema that modifies the type produced by this schema to be optional.

Returns a new schema that modifies the type produced by this schema to be optional.

Attributes

Inherited from:
Schema
def orElseEither[B](that: Schema[B]): Schema[Either[Either[A, B], B]]

Returns a new schema that combines this schema and the specified schema together, modeling their either composition.

Returns a new schema that combines this schema and the specified schema together, modeling their either composition.

Attributes

Inherited from:
Schema
def ordering: Ordering[Either[A, B]]

Attributes

Inherited from:
Schema
def patch(oldValue: Either[A, B], diff: Patch[Either[A, B]]): Either[String, Either[A, B]]

Patch value with a Patch.

Patch value with a Patch.

Attributes

Inherited from:
Schema

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product
def repeated: Schema[Chunk[Either[A, B]]]

Attributes

Inherited from:
Schema

Attributes

Inherited from:
Schema
def toDynamic(value: Either[A, B]): DynamicValue

Attributes

Inherited from:
Schema
def transform[B](f: (Either[A, B]) => B, g: B => Either[A, B])(implicit loc: SourceLocation): Schema[B]

Transforms this Schema[A] into a Schema[B], by supplying two functions that can transform between A and B, without possibility of failure.

Transforms this Schema[A] into a Schema[B], by supplying two functions that can transform between A and B, without possibility of failure.

Attributes

Inherited from:
Schema
def transformOrFail[B](f: (Either[A, B]) => Either[String, B], g: B => Either[String, Either[A, B]])(implicit loc: SourceLocation): Schema[B]

Transforms this Schema[A] into a Schema[B], by supplying two functions that can transform between A and B (possibly failing in some cases).

Transforms this Schema[A] into a Schema[B], by supplying two functions that can transform between A and B (possibly failing in some cases).

Attributes

Inherited from:
Schema
def validate(value: Either[A, B])(implicit schema: Schema[Either[A, B]]): Chunk[ValidationError]

Attributes

Inherited from:
Schema
def validation(validation: Validation[Either[A, B]]): Schema[Either[A, B]]

Attributes

Inherited from:
Schema
def zip[B](that: Schema[B]): Schema[(Either[A, B], B)]

Returns a new schema that combines this schema and the specified schema together, modeling their tuple composition.

Returns a new schema that combines this schema and the specified schema together, modeling their tuple composition.

Attributes

Inherited from:
Schema

Concrete fields

val leftSchema: Schema[Left[A, Nothing]]
val leftSingleton: String
val rightSchema: Schema[Right[Nothing, B]]
val rightSingleton: String
val toEnum: Enum2[Right[Nothing, B], Left[A, Nothing], Either[A, B]]