final case class Either[A, B](left: Schema[A], right: Schema[B], annotations: Chunk[Any] = Chunk.empty) extends Schema[scala.util.Either[A, B]] with Product with Serializable
- Self Type
- Either[A, B]
- Alphabetic
- By Inheritance
- Either
- Serializable
- Product
- Equals
- Schema
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
Type Members
- type Accessors[Lens[_, _, _], Prism[_, _, _], Traversal[_, _]] = (Prism[rightSingleton.type, scala.util.Either[A, B], Right[Nothing, B]], Prism[leftSingleton.type, scala.util.Either[A, B], Left[A, Nothing]])
- type LeftType = A
- type RightType = B
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- def <*>[B](that: Schema[B]): Schema[(scala.util.Either[A, B], B)]
A symbolic operator for zip.
- def <+>[B](that: Schema[B]): Schema[scala.util.Either[scala.util.Either[A, B], B]]
A symbolic operator for orElseEither.
A symbolic operator for orElseEither.
- Definition Classes
- Schema
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def ?: Schema[Option[scala.util.Either[A, B]]]
A symbolic operator for optional.
- def annotate(annotation: Any): Either[A, B]
Returns a new schema that with
annotation
- val annotations: Chunk[Any]
Chunk of annotations for this schema
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def ast: MetaSchema
- Definition Classes
- Schema
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def coerce[B](newSchema: Schema[B]): scala.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,_]
- Definition Classes
- Schema
- def defaultValue: scala.util.Either[String, scala.util.Either[A, B]]
The default value for a
Schema
of typeA
. - def diff(thisValue: scala.util.Either[A, B], thatValue: scala.util.Either[A, B]): Patch[scala.util.Either[A, B]]
Performs a diff between thisValue and thatValue.
Performs a diff between thisValue and thatValue. See zio.schema.Differ for details on the default diff algorithms.
- Definition Classes
- Schema
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def fromDynamic(value: DynamicValue): scala.util.Either[String, scala.util.Either[A, B]]
- Definition Classes
- Schema
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- val left: Schema[A]
- val leftSchema: Schema[Left[A, Nothing]]
- val leftSingleton: String
- def makeAccessors(b: AccessorBuilder): (Prism[rightSingleton.type, scala.util.Either[A, B], Right[Nothing, B]], Prism[leftSingleton.type, scala.util.Either[A, B], Left[A, Nothing]])
- def migrate[B](newSchema: Schema[B]): scala.Either[String, (scala.util.Either[A, B]) => scala.util.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
- Definition Classes
- Schema
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def optional: Schema[Option[scala.util.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.
- Definition Classes
- Schema
- def orElseEither[B](that: Schema[B]): Schema[scala.util.Either[scala.util.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.
- Definition Classes
- Schema
- def ordering: Ordering[scala.util.Either[A, B]]
- Definition Classes
- Schema
- def patch(oldValue: scala.util.Either[A, B], diff: Patch[scala.util.Either[A, B]]): scala.util.Either[String, scala.util.Either[A, B]]
Patch value with a Patch.
Patch value with a Patch.
- Definition Classes
- Schema
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- def repeated: Schema[Chunk[scala.util.Either[A, B]]]
- Definition Classes
- Schema
- val right: Schema[B]
- val rightSchema: Schema[Right[Nothing, B]]
- val rightSingleton: String
- def serializable: Schema[Schema[scala.util.Either[A, B]]]
- Definition Classes
- Schema
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toDynamic(value: scala.util.Either[A, B]): DynamicValue
- Definition Classes
- Schema
- val toEnum: Enum2[Right[Nothing, B], Left[A, Nothing], scala.util.Either[A, B]]
- def transform[B](f: (scala.util.Either[A, B]) => B, g: (B) => scala.util.Either[A, B])(implicit loc: SourceLocation): Schema[B]
Transforms this
Schema[A]
into aSchema[B]
, by supplying two functions that can transform betweenA
andB
, without possibility of failure.Transforms this
Schema[A]
into aSchema[B]
, by supplying two functions that can transform betweenA
andB
, without possibility of failure.- Definition Classes
- Schema
- def transformOrFail[B](f: (scala.util.Either[A, B]) => scala.util.Either[String, B], g: (B) => scala.util.Either[String, scala.util.Either[A, B]])(implicit loc: SourceLocation): Schema[B]
Transforms this
Schema[A]
into aSchema[B]
, by supplying two functions that can transform betweenA
andB
(possibly failing in some cases).Transforms this
Schema[A]
into aSchema[B]
, by supplying two functions that can transform betweenA
andB
(possibly failing in some cases).- Definition Classes
- Schema
- def validate(value: scala.util.Either[A, B])(implicit schema: Schema[scala.util.Either[A, B]]): Chunk[ValidationError]
- Definition Classes
- Schema
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- def zip[B](that: Schema[B]): Schema[(scala.util.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.
- Definition Classes
- Schema