Interface Context

  • All Implemented Interfaces:
    com.embabel.common.core.types.HasInfoString

    
    public interface Context
     implements HasInfoString
                        

    Implemented by instances that can hold longer lasting state than a blackboard. Offers the same ability to add an object or bind it to a key.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract Unit bind(String key, Object value)
      abstract Unit addObject(Object value)
      <T extends Any> T last(Class<T> clazz) Get the last object of the given type, or null if none.
      abstract Unit populate(Blackboard blackboard) Populate the given blackboard from the context.
      abstract String getId() May be null for a new context not yet saved.
      abstract List<Object> getObjects() Entries in the order they were added.
      • Methods inherited from class com.embabel.common.core.types.HasInfoString

        infoString
      • Methods inherited from class java.lang.Object

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

    • Method Detail

      • last

         <T extends Any> T last(Class<T> clazz)

        Get the last object of the given type, or null if none.

      • getId

         abstract String getId()

        May be null for a new context not yet saved.

      • getObjects

         abstract List<Object> getObjects()

        Entries in the order they were added. The default instance of any type is the last one Objects are immutable and may not be removed.