ZWorkflowState

zio.temporal.state.ZWorkflowState
See theZWorkflowState companion object
sealed trait ZWorkflowState[A]

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Optional[A]
class Required[A]

Members list

Value members

Abstract methods

def exists(p: A => Boolean): Boolean

Returns true if this State is initialized '''and''' the predicate $p returns true when applied to this state value. Otherwise, returns false.

Returns true if this State is initialized '''and''' the predicate $p returns true when applied to this state value. Otherwise, returns false.

Value parameters

p

the predicate to test

Attributes

def forall(p: A => Boolean): Boolean

Returns true if this state is uninitialized '''or''' the predicate p returns true when applied to this state value.

Returns true if this state is uninitialized '''or''' the predicate p returns true when applied to this state value.

Value parameters

p

the predicate to test

Attributes

def setTo(value: A): ZWorkflowState.this.type

Replaces the state value

Replaces the state value

Value parameters

value

new state value

Attributes

Returns

this state updated

def snapshotOrElse(default: => A): A

Takes a snapshot of the state or returns the provided default value

Takes a snapshot of the state or returns the provided default value

Value parameters

default

the default value

Attributes

Returns

the state or default value

def toEither[E](left: => E): Either[E, A]

Converts this state to Either

Converts this state to Either

Type parameters

E

error type

Value parameters

left

error value which will be used when state is not initialized

Attributes

Returns

the state value or Left

def toOption: Option[A]

Converts this state to Option

Converts this state to Option

Attributes

Returns

the state value or None

def update(f: A => A): ZWorkflowState.this.type

Updates the state value

Updates the state value

Value parameters

f

updating function

Attributes

Returns

this state updated

def updateWhen(pf: PartialFunction[A, A]): ZWorkflowState.this.type

Updates the state when partial function matches

Updates the state when partial function matches

Value parameters

pf

updating function

Attributes

Returns

this state updated

Concrete methods

def ++=(values: Iterable[(K, V)]): ZWorkflowState[Map[K, V]]
Implicitly added by ZWorkflowStateMapOps
def +=(pair: (K, V)): ZWorkflowState[Map[K, V]]
Implicitly added by ZWorkflowStateMapOps
def --=(keys: Iterable[K]): ZWorkflowState[Map[K, V]]
Implicitly added by ZWorkflowStateMapOps
def -=(key: K): ZWorkflowState[Map[K, V]]
Implicitly added by ZWorkflowStateMapOps
def :=(value: A): ZWorkflowState.this.type

Replaces the state value

Replaces the state value

Value parameters

value

new state value

Attributes

Returns

this state updated

def =!=(that: A): Boolean

Returns true if this State is initialized '''and''' the equals to the provided value. Otherwise, returns false.

Returns true if this State is initialized '''and''' the equals to the provided value. Otherwise, returns false.

Value parameters

that

value to check with

Attributes

Returns

whenever they're equal

def =:=(that: A): Boolean

Returns true if this State is initialized '''and''' the equals to the provided value. Otherwise, returns false.

Returns true if this State is initialized '''and''' the equals to the provided value. Otherwise, returns false.

Value parameters

that

value to check with

Attributes

Returns

whenever they're equal

def apply(key: K): V
Implicitly added by ZWorkflowStateMapOps
def clear(): ZWorkflowState[Map[K, V]]
Implicitly added by ZWorkflowStateMapOps
def filterInPlace(p: (K, V) => Boolean): ZWorkflowState[Map[K, V]]
Implicitly added by ZWorkflowStateMapOps
def filterKeysInPlace(p: K => Boolean): ZWorkflowState[Map[K, V]]
Implicitly added by ZWorkflowStateMapOps
def get(key: K): Option[V]
Implicitly added by ZWorkflowStateMapOps
def getOrElse(key: K, default: => V): V
Implicitly added by ZWorkflowStateMapOps
def remove(key: K): ZWorkflowState[Map[K, V]]
Implicitly added by ZWorkflowStateMapOps
def setToIf(p: Boolean)(value: => A): ZWorkflowState.this.type

Updates the state when the predicate holds

Updates the state when the predicate holds

Value parameters

p

the condition

value

possible new state value

Attributes

Returns

this state updated

def setToUnless(p: Boolean)(value: => A): ZWorkflowState.this.type

Updates the state unless the predicate holds

Updates the state unless the predicate holds

Value parameters

p

the condition

value

possible new state value

Attributes

Returns

this state updated

def snapshot: A

Takes a snapshot of the state or throws an error

Takes a snapshot of the state or throws an error

Attributes

Returns

the state value

def snapshotOf[B](f: A => B): B

Takes a snapshot of the state applying a function to it ors throw an error

Takes a snapshot of the state applying a function to it ors throw an error

Value parameters

f

arbitrary function

Attributes

Returns

the result of function application on this state

def update(key: K, value: V): ZWorkflowState[Map[K, V]]
Implicitly added by ZWorkflowStateMapOps
def updateIf(p: Boolean)(f: A => A): ZWorkflowState.this.type

Updates the state when the predicate holds

Updates the state when the predicate holds

Value parameters

f

updating function

p

the condition

Attributes

Returns

this state updated

def updateUnless(p: Boolean)(f: A => A): ZWorkflowState.this.type

Updates the state unless the predicate holds

Updates the state unless the predicate holds

Value parameters

f

updating function

p

the condition

Attributes

Returns

this state updated

Concrete fields

val self: ZWorkflowState[Map[K, V]]
Implicitly added by ZWorkflowStateMapOps