Packages

o

h8io.stages.std

Identity

object Identity extends Endo[Any]

A stage that passes its input through unchanged.

Identity is a singleton h8io.stages.base.Fn that acts as the identity function: given any value, it returns the same value. It always succeeds (h8io.stages.Status.Success) and never changes state.

The singleton operates on Any and can be safely cast to any specific Fn.Endo[T] via the apply[T] method, avoiding allocation on every use.

Example:

val stage: Fn.Endo[String] = Identity[String]
Source
Identity.scala
Linear Supertypes
Fn[Any, Any], SAMStage[Any, Any, Nothing], Stagnation[Any, Any, Nothing], Evolution[Any, Any, Nothing], Fruitful[Any, Any, Nothing], Stage[Any, Any, Nothing], (Any) => Yield[Any, Any, Nothing], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Identity
  2. Fn
  3. SAMStage
  4. Stagnation
  5. Evolution
  6. Fruitful
  7. Stage
  8. Function1
  9. AnyRef
  10. 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[Any, Any, Nothing]) => A): (Any) => A
    Definition Classes
    Function1
    Annotations
    @unspecialized()
  5. def apply[T]: Endo[T]

    Returns a typed view of this singleton as a Fn.Endo[T].

    Returns a typed view of this singleton as a Fn.Endo[T].

    T

    the concrete value type

  6. final def apply(in: Any): Some[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
    FnFruitfulStage → 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[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) => Any): (A) => Yield[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[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: 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. def f(in: Any): Any

    The pure mapping function applied to each input value.

    The pure mapping function applied to each input value.

    in

    the input value

    returns

    the computed output value

    Definition Classes
    IdentityFn
  17. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  18. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  19. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  20. final def map[_I, _O, _E](f: (Stage[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()
  21. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  22. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  23. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  24. final def skip(): Evolution[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
  25. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  26. def toString(): String
    Definition Classes
    Function1 → AnyRef → Any
  27. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  28. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  29. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  30. final def ~>[_O, _E >: Nothing](that: Stage[Any, _O, _E]): Stage[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 Fn[Any, Any]

Inherited from SAMStage[Any, Any, Nothing]

Inherited from Stagnation[Any, Any, Nothing]

Inherited from Evolution[Any, Any, Nothing]

Inherited from Fruitful[Any, Any, Nothing]

Inherited from Stage[Any, Any, Nothing]

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

Inherited from AnyRef

Inherited from Any

Ungrouped