Class LocalMessage.LocalEnvironment<I extends Id<O>,​O,​E>

java.lang.Object
org.jmanikin.message.LocalMessage.LocalEnvironment<I,​O,​E>
Type Parameters:
I - the Id Type
O - the Object Type
E - the Effect Type
All Implemented Interfaces:
Apply<I,​O,​E>, Effect<I,​O,​E>, Environment<I,​O,​E>, Msg<I,​O,​E>, PostCondition<I,​O,​E>, PreCondition<I,​O,​E>
Enclosing interface:
LocalMessage<I extends Id<O>,​O,​E>

public static class LocalMessage.LocalEnvironment<I extends Id<O>,​O,​E>
extends java.lang.Object
implements Environment<I,​O,​E>, PreCondition<I,​O,​E>, Apply<I,​O,​E>, Effect<I,​O,​E>, PostCondition<I,​O,​E>, Msg<I,​O,​E>
LocalEnvironment implementation that sets the ThreadLocal variable at each Stage.
  • Constructor Summary

    Constructors
    Constructor Description
    LocalEnvironment​(Environment<I,​O,​E> env)  
  • Method Summary

    Modifier and Type Method Description
    java.util.function.Supplier<O> app()
    Returns the lazy Object O supplier that was build by the builder.
    Effect<I,​O,​E> app​(java.util.function.Supplier<O> app)
    Build the next Effect stage, given a lazy Object O supplier.
    java.util.function.Supplier<E> eff()
    Returns the lazy Effect E supplier that was build by the builder.
    PostCondition<I,​O,​E> eff​(java.util.function.Supplier<E> eff)
    Build the next post-condition stage, given a lazy effect R supplier.
    O obj()
    Returns the current Object O
    <O2> O2 obj​(Id<? extends O2> id)
    Returns the current Object O2, given its id
    O old()
    Returns the old Object O
    <O2> O2 old​(Id<? extends O2> id)
    Returns the old Object O2, given its id
    java.util.function.Supplier<java.lang.Boolean> pre()
    Returns the lazy pre-condition supplier that was build by the builder.
    Apply<I,​O,​E> pre​(java.util.function.Supplier<java.lang.Boolean> pre)
    Build the next Apply stage, given a lazy pre-condition supplier.
    java.util.function.Supplier<java.lang.Boolean> pst()
    Returns the lazy post-condition supplier that was build by the builder.
    Msg<I,​O,​E> pst​(java.util.function.Supplier<java.lang.Boolean> pst)
    Build the next Msg stage, given a lazy post-condition supplier.
    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 class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • LocalEnvironment

      public LocalEnvironment​(Environment<I,​O,​E> env)
  • Method Details

    • self

      public I self()
      Description copied from interface: Environment
      Returns the Object identifier that's in scope
      Specified by:
      self in interface Environment<I extends Id<O>,​O,​E>
      Returns:
      the Object identifier
    • obj

      public O obj()
      Description copied from interface: Environment
      Returns the current Object O
      Specified by:
      obj in interface Environment<I extends Id<O>,​O,​E>
      Returns:
      the Object O
    • old

      public O old()
      Description copied from interface: Environment
      Returns the old Object O
      Specified by:
      old in interface Environment<I extends Id<O>,​O,​E>
      Returns:
      the Object O
    • obj

      public <O2> O2 obj​(Id<? extends O2> id)
      Description copied from interface: Environment
      Returns the current Object O2, given its id
      Specified by:
      obj in interface Environment<I extends Id<O>,​O,​E>
      Type Parameters:
      O2 - the Object type
      Parameters:
      id - the Object identifier
      Returns:
      the current Object O2
    • old

      public <O2> O2 old​(Id<? extends O2> id)
      Description copied from interface: Environment
      Returns the old Object O2, given its id
      Specified by:
      old in interface Environment<I extends Id<O>,​O,​E>
      Type Parameters:
      O2 - the Object type
      Parameters:
      id - the Object identifier
      Returns:
      the current Object O2
    • send

      public <I2 extends Id<O2>,​ O2,​ R2> R2 send​(I2 id, Message<I2,​O2,​R2> msg)
      Description copied from interface: Environment
      Sends a Message to Object O, given an Object identifier
      Specified by:
      send in interface Environment<I extends Id<O>,​O,​E>
      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
    • pre

      public Apply<I,​O,​E> pre​(java.util.function.Supplier<java.lang.Boolean> pre)
      Description copied from interface: PreCondition
      Build the next Apply stage, given a lazy pre-condition supplier.
      Specified by:
      pre in interface PreCondition<I extends Id<O>,​O,​E>
      Parameters:
      pre - the supplier of the pre-condition
      Returns:
      the Apply stage
    • app

      public Effect<I,​O,​E> app​(java.util.function.Supplier<O> app)
      Description copied from interface: Apply
      Build the next Effect stage, given a lazy Object O supplier.
      Specified by:
      app in interface Apply<I extends Id<O>,​O,​E>
      Parameters:
      app - the supplier of the new Object O
      Returns:
      the Effect stage
    • eff

      public PostCondition<I,​O,​E> eff​(java.util.function.Supplier<E> eff)
      Description copied from interface: Effect
      Build the next post-condition stage, given a lazy effect R supplier.
      Specified by:
      eff in interface Effect<I extends Id<O>,​O,​E>
      Parameters:
      eff - the supplier of the post-condition R
      Returns:
      the post-condition stage
    • pst

      public Msg<I,​O,​E> pst​(java.util.function.Supplier<java.lang.Boolean> pst)
      Description copied from interface: PostCondition
      Build the next Msg stage, given a lazy post-condition supplier.
      Specified by:
      pst in interface PostCondition<I extends Id<O>,​O,​E>
      Parameters:
      pst - the supplier of the post-condition
      Returns:
      the Msg stage
    • pre

      public java.util.function.Supplier<java.lang.Boolean> pre()
      Description copied from interface: Msg
      Returns the lazy pre-condition supplier that was build by the builder.
      Specified by:
      pre in interface Msg<I extends Id<O>,​O,​E>
      Returns:
      the pre-condition supplier
    • app

      public java.util.function.Supplier<O> app()
      Description copied from interface: Msg
      Returns the lazy Object O supplier that was build by the builder.
      Specified by:
      app in interface Msg<I extends Id<O>,​O,​E>
      Returns:
      the Object O supplier
    • eff

      public java.util.function.Supplier<E> eff()
      Description copied from interface: Msg
      Returns the lazy Effect E supplier that was build by the builder.
      Specified by:
      eff in interface Msg<I extends Id<O>,​O,​E>
      Returns:
      the Effect E supplier
    • pst

      public java.util.function.Supplier<java.lang.Boolean> pst()
      Description copied from interface: Msg
      Returns the lazy post-condition supplier that was build by the builder.
      Specified by:
      pst in interface Msg<I extends Id<O>,​O,​E>
      Returns:
      the post-condition supplier