Packages

  • package root
    Definition Classes
    root
  • package h8io
    Definition Classes
    root
  • package stages
    Definition Classes
    h8io
  • package cats
    Definition Classes
    stages
  • object Validated

    Stage projections for cats.data.Validated.

    Stage projections for cats.data.Validated.

    cats.data.Validated[L, R] is a right-biased validation type where Invalid(l) holds an error value and Valid(r) holds a success value. The two projections here allow a pipeline to route values based on which side is present, producing h8io.stages.Yield.Some for the expected side and h8io.stages.Yield.None otherwise. In both cases the status is h8io.stages.Status.Success.

    Example:

    import h8io.stages.cats.Validated
    
    val validStage   = Validated.Valid[String]    // Stage[cats.data.Validated[?, String], String, Nothing]
    val invalidStage = Validated.Invalid[String]  // Stage[cats.data.Validated[String, ?], String, Nothing]
    Definition Classes
    cats
  • Invalid
  • Valid

object Invalid extends LeftProjection[Validated]

Extracts the Invalid (left/error) value, yielding nothing for Valid values.

Use Validated.Invalid[T] to get a typed Projection[Validated[T, ?], T].

Source
Validated.scala
Linear Supertypes
LeftProjection[Validated], Projection[Validated[Any, _], Any], StaticStage[Validated[Any, _], Any, Nothing], SAMStage[Validated[Any, _], Any, Nothing], Stagnation[Validated[Any, _], Any, Nothing], Evolution[Validated[Any, _], Any, Nothing], Stage[Validated[Any, _], Any, Nothing], (Validated[Any, _]) => Yield[Validated[Any, _], Any, Nothing], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Invalid
  2. LeftProjection
  3. Projection
  4. StaticStage
  5. SAMStage
  6. Stagnation
  7. Evolution
  8. Stage
  9. Function1
  10. AnyRef
  11. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def andThen[A](g: (Yield[Validated[Any, _], Any, Nothing]) => A): (Validated[Any, _]) => A
    Definition Classes
    Function1
    Annotations
    @unspecialized()
  5. final def apply[T]: Projection[Validated[T, _], T]

    Returns a typed view of this projection for left-side values of type T.

    Returns a typed view of this projection for left-side values of type T.

    The cast is safe because C is covariant in both parameters and the projection only reads (never writes) the container.

    T

    the concrete left-side type

    returns

    this projection typed as Projection[C[T, ?], T]

    Definition Classes
    LeftProjection
  6. final def apply(in: Validated[Any, _]): Yield[Validated[Any, _], Any, Nothing]

    Applies this stage to the given input, producing a Yield.

    Applies this stage to the given input, producing a Yield.

    in

    the input value

    returns

    a Yield containing the optional output, status, and evolution

    Definition Classes
    StaticStageStage → Function1
  7. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  8. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
  9. final def compose[_O, _E >: Nothing](that: Evolution[Any, _O, _E]): Evolution[Validated[Any, _], _O, _E]

    Composes this evolution with another, creating a new evolution whose continuation for any status is the sequential composition of the corresponding continuations of both evolutions.

    Composes this evolution with another, creating a new evolution whose continuation for any status is the sequential composition of the corresponding continuations of both evolutions.

    Specifically:

    composed(s) == self(s) ~> that(s)

    Used internally when merging evolutions during Yield composition inside Stage.AndThen.

    _O

    the output type of the resulting stages

    _E

    the combined error type

    that

    the downstream evolution to compose with

    returns

    a new evolution representing self followed by that

    Definition Classes
    Evolution
    Annotations
    @inline()
  10. def compose[A](g: (A) => Validated[Any, _]): (A) => Yield[Validated[Any, _], Any, Nothing]
    Definition Classes
    Function1
    Annotations
    @unspecialized()
  11. def dispose(): Unit

    Releases all resources held by the Stage that produced this evolution.

    Releases all resources held by the Stage that produced this evolution.

    After this call the producing stage must be considered permanently unusable — it must not be applied or skipped again. This is the exclusive cleanup point for resources owned by the producing stage.

    Called when the producing stage is permanently shut down:

    • by Stage.execute after the pipeline has produced its terminal Outcome, so the continuation is released immediately rather than carried forward;
    • when apply throws a Throwable, since the stage can no longer be used and all its resources must still be released.

    Implementations that hold no external resources may leave this as a no-op.

    Definition Classes
    StagnationEvolution
  12. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  14. final def evolve(status: Status[_]): Stage[Validated[Any, _], Any, Nothing]

    Returns the next Stage based on the given status.

    Returns the next Stage based on the given status.

    May release resources that are specific to this evolution instance and will not be reused by subsequent generations (i.e. resources not needed by the returned stage or its own evolution).

    status

    the status that determines the continuation stage

    Definition Classes
    StagnationEvolution
  15. final def execute(in: Validated[Any, _]): Outcome[Any, Nothing]

    Executes this stage end-to-end and returns a plain Outcome.

    Executes this stage end-to-end and returns a plain Outcome.

    Internally this method:

    1. Applies the stage to in, obtaining a Yield.
    2. Disposes the Evolution carried by the Yield — since execute is a terminal operation, the continuation is not needed and the resources held by this stage must be released immediately.
    3. Wraps the result in an Outcome.Some or Outcome.None.

    Disposal failures do not prevent the result from being returned. Any non-fatal exception raised by Evolution.dispose is captured in Outcome.disposeFailure and the outcome is still produced. Fatal exceptions are not caught and will propagate.

    in

    the input value

    returns

    Outcome.Some if this stage produced an output, Outcome.None otherwise

    Definition Classes
    Stage
    Annotations
    @inline()
  16. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  17. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  18. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  19. final def map[_I, _O, _E](f: (Stage[Validated[Any, _], Any, Nothing]) => Stage[_I, _O, _E]): Evolution[_I, _O, _E]

    Transforms every continuation of this evolution by applying f to the stage it returns.

    Transforms every continuation of this evolution by applying f to the stage it returns.

    This is the public API for adapting an Evolution to a different stage type without exposing internal composition details.

    _I

    the input type of the resulting stages

    _O

    the output type of the resulting stages

    _E

    the error type of the resulting stages

    f

    a function that transforms each continuation stage

    returns

    a new evolution with all continuations mapped by f

    Definition Classes
    Evolution
    Annotations
    @inline()
  20. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  21. val none: None[Nothing]

    A pre-built h8io.stages.Yield.None used when the container holds no value for this projection.

    A pre-built h8io.stages.Yield.None used when the container holds no value for this projection.

    Attributes
    protected
    Definition Classes
    Projection
  22. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  23. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  24. def process(in: Validated[Any, _]): StaticYield[Any, Nothing]

    The processing logic for this stage.

    The processing logic for this stage.

    in

    the input value

    returns

    a h8io.stages.base.StaticYield describing whether an output was produced and the resulting h8io.stages.Status

    Definition Classes
    InvalidStaticStage
  25. final def skip(): Evolution[Validated[Any, _], Any, Nothing]

    Returns the Evolution for this stage without processing any input.

    Returns the Evolution for this stage without processing any input.

    Any stage that participates in a pipeline run but does not process the current input must call skip() instead of apply. Common triggers: an upstream stage produced no output (Yield.None), or a non-inclusive binary operation excluded this branch. The stage must return its Evolution as it would have appeared had it run, but must not perform any side effects or consume input.

    See the Lifecycle section in Stage for the full contract.

    returns

    the Evolution representing how the pipeline should continue from this stage

    Definition Classes
    SAMStageStage
  26. def some(out: Any): Some[Any, Nothing]

    Creates a successful h8io.stages.Yield.Some carrying out.

    Creates a successful h8io.stages.Yield.Some carrying out.

    Attributes
    protected
    Definition Classes
    Projection
  27. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  28. def toString(): String
    Definition Classes
    Function1 → AnyRef → Any
  29. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  30. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  31. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  32. final def ~>[_O, _E >: Nothing](that: Stage[Any, _O, _E]): Stage[Validated[Any, _], _O, _E]

    Composes this stage with that, producing a new stage that feeds the output of this stage into that.

    Composes this stage with that, producing a new stage that feeds the output of this stage into that.

    The resulting Stage.AndThen feeds the output of this stage into that. If this stage produces an output, the statuses and evolutions of both stages are merged; if it produces no output, only the evolutions are composed and that is not invoked for the current input.

    _O

    the output type of the composed pipeline

    _E

    the combined error type (must be a supertype of E)

    that

    the stage to execute after this one

    returns

    a composed stage this ~> that

    Definition Classes
    Stage
    Annotations
    @inline()

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

Inherited from LeftProjection[Validated]

Inherited from Projection[Validated[Any, _], Any]

Inherited from StaticStage[Validated[Any, _], Any, Nothing]

Inherited from SAMStage[Validated[Any, _], Any, Nothing]

Inherited from Stagnation[Validated[Any, _], Any, Nothing]

Inherited from Evolution[Validated[Any, _], Any, Nothing]

Inherited from Stage[Validated[Any, _], Any, Nothing]

Inherited from (Validated[Any, _]) => Yield[Validated[Any, _], Any, Nothing]

Inherited from AnyRef

Inherited from Any

Ungrouped