Interface Environment<I extends Id<O>,​O,​E>

Type Parameters:
I - the Id Type
O - the Object Type
E - the Effect Type
All Superinterfaces:
PreCondition<I,​O,​E>
All Known Subinterfaces:
AccountModule.AccountMsg, LocalMessage<I,​O,​E>, TestModule.LMsg<E>, TransferModule.TransferMsg
All Known Implementing Classes:
AccountModule.Deposit, AccountModule.Open, AccountModule.Withdraw, LocalMessage.LocalEnvironment, TestModule.LocalCopyId, TestModule.LocalSendSetMember, TestModule.LocalSetMember, TestModule.ThrowPstException, TransferModule.Book

public interface Environment<I extends Id<O>,​O,​E>
extends PreCondition<I,​O,​E>

An Environment is the self scope that is provided/injected when evaluating a Msg.

All lookups and Messages should be dispatched via this Environment.

  • Method Summary

    Modifier and Type Method Description
    default O obj()
    Returns the current Object O
    <O2> O2 obj​(Id<? extends O2> id)
    Returns the current Object O2, given its id
    default O old()
    Returns the old Object O
    <O2> O2 old​(Id<? extends O2> id)
    Returns the old Object O2, given its id
    I self()
    Returns the Object identifier that's in scope
    <I2 extends Id<O2>,​ O2,​ R2>
    R2
    send​(I2 id, Message<I2,​O2,​R2> msg)
    Sends a Message to Object O, given an Object identifier

    Methods inherited from interface org.jmanikin.core.PreCondition

    pre
  • Method Details

    • self

      I self()
      Returns the Object identifier that's in scope
      Returns:
      the Object identifier
    • obj

      default O obj()
      Returns the current Object O
      Returns:
      the Object O
    • old

      default O old()
      Returns the old Object O
      Returns:
      the Object O
    • obj

      <O2> O2 obj​(Id<? extends O2> id)
      Returns the current Object O2, given its id
      Type Parameters:
      O2 - the Object type
      Parameters:
      id - the Object identifier
      Returns:
      the current Object O2
    • old

      <O2> O2 old​(Id<? extends O2> id)
      Returns the old Object O2, given its id
      Type Parameters:
      O2 - the Object type
      Parameters:
      id - the Object identifier
      Returns:
      the current Object O2
    • send

      <I2 extends Id<O2>,​ O2,​ R2> R2 send​(I2 id, Message<I2,​O2,​R2> msg)
      Sends a Message to Object O, given an Object identifier
      Type Parameters:
      I2 - the Id Type
      O2 - the Object Type
      R2 - the Reference Type
      Parameters:
      id - the Object identifier to send the Message to
      msg - the message to send to the Object
      Returns:
      the effect R of the Message send