Package org.robolectric.shadows
Class ShadowMessage
java.lang.Object
org.robolectric.shadows.ShadowMessage
- Direct Known Subclasses:
- ShadowLegacyMessage,- ShadowPausedMessage
@Implements(value=android.os.Message.class, shadowPicker=Picker.class) public abstract class ShadowMessage extends Object
The shadow API for 
Message.
 Different shadow implementations will be used depending on the current LooperMode. See
 ShadowLegacyMessage and ShadowPausedMessage for details.
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classShadowMessage.PickerThe shadow Picker for this class
- 
Constructor SummaryConstructors Constructor Description ShadowMessage()
- 
Method SummaryModifier and Type Method Description abstract MessagegetNext()Convenience method to provide getter access to the private fieldMessage.next.abstract voidrecycleUnchecked()Exposes the package-privateMessage.recycleUnchecked()static voidreset()Resets the static state of theMessageclass by emptying the message pool.abstract voidsetNext(Message next)Convenience method to provide setter access to the private fieldMessage.next.abstract voidsetScheduledRunnable(Runnable r)Stores theRunnableinstance that has been scheduled to invoke this message.
- 
Constructor Details- 
ShadowMessagepublic ShadowMessage()
 
- 
- 
Method Details- 
recycleUncheckedpublic abstract void recycleUnchecked()Exposes the package-privateMessage.recycleUnchecked()
- 
setScheduledRunnableStores theRunnableinstance that has been scheduled to invoke this message. This is called when the message is enqueued byShadowLegacyMessageQueue.enqueueMessage(android.os.Message, long)and is used when the message is recycled to ensure that the correctRunnableinstance is removed from the associated scheduler.- Parameters:
- r- the- Runnableinstance that is scheduled to trigger this message.- #if ($api >= 21) * @see #recycleUnchecked() #else * @see #recycle() #end - Only supported in - LooperMode.Mode.LEGACY.
 
- 
getNextConvenience method to provide getter access to the private fieldMessage.next.Only supported in LooperMode.Mode.LEGACY- Returns:
- The next message in the current message chain.
- See Also:
- setNext(Message)
 
- 
setNextConvenience method to provide setter access to the private fieldMessage.next.Only supported in LooperMode.Mode.LEGACY- Parameters:
- next- the new next message for the current message.
- See Also:
- getNext()
 
- 
resetResets the static state of theMessageclass by emptying the message pool.
 
-