Package com.offbynull.coroutines.user
Class SerializedState
- java.lang.Object
-
- com.offbynull.coroutines.user.SerializedState
-
- All Implemented Interfaces:
java.io.Serializable
public final class SerializedState extends java.lang.Object implements java.io.Serializable
CoroutineRunner
's state translated for serialization.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SerializedState.Data
Data bundle.static class
SerializedState.Frame
MethodState
's andLockState
's state translated for serialization.static class
SerializedState.FrameInterceptPoint
Frame intercept point.static interface
SerializedState.FrameModifier
Frame modifier.static class
SerializedState.FrameUpdatePoint
Frame update point.static class
SerializedState.VersionedFrame
Collection ofSerializedState.Frame
s that are for different versions of the same method and continuation point combination.
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Object
context
private Coroutine
coroutine
private SerializedState.VersionedFrame[]
frames
private static long
serialVersionUID
-
Constructor Summary
Constructors Constructor Description SerializedState(Coroutine coroutine, java.lang.Object context, SerializedState.VersionedFrame[] frames)
Constructs aSerializedState
object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
getContext()
Get coroutine context.Coroutine
getCoroutine()
Get coroutine.SerializedState.VersionedFrame[]
getFrames()
Get coroutine method states.(package private) void
validateState()
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
coroutine
private final Coroutine coroutine
-
context
private final java.lang.Object context
-
frames
private final SerializedState.VersionedFrame[] frames
-
-
Constructor Detail
-
SerializedState
public SerializedState(Coroutine coroutine, java.lang.Object context, SerializedState.VersionedFrame[] frames)
Constructs aSerializedState
object.- Parameters:
coroutine
- coroutine objectcontext
- coroutine contextframes
- method states- Throws:
java.lang.NullPointerException
- ifframes
java.lang.IllegalArgumentException
- if any elements offrame
arenull
or are otherwise in an invalid state
-
-
Method Detail
-
getCoroutine
public Coroutine getCoroutine()
Get coroutine.- Returns:
- coroutine
-
getContext
public java.lang.Object getContext()
Get coroutine context.- Returns:
- coroutine context
-
getFrames
public SerializedState.VersionedFrame[] getFrames()
Get coroutine method states.- Returns:
- coroutine method states
-
validateState
void validateState()
-
-