Class InMemoryAssetTracker

  • All Implemented Interfaces:
    com.embabel.chat.AssetTracker , com.embabel.chat.AssetView

    
    public final class InMemoryAssetTracker
     implements AssetTracker
                        

    Simple in-memory implementation of AssetTracker for testing and ephemeral use cases.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private final List<Asset> assets
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      List<Asset> getAssets() All tracked assets, in order in which they were added
      Unit addAsset(Asset asset) Add an asset to be tracked.
      • Methods inherited from class com.embabel.chat.AssetTracker

        addAnyReturnedAssets, addReturnedAssets
      • Methods inherited from class com.embabel.chat.AssetView

        mostRecent, mostRecentlyAdded, references, since
      • Methods inherited from class java.lang.Object

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

      • InMemoryAssetTracker

        InMemoryAssetTracker(Collection<Asset> initialAssets)
    • Method Detail

      • addAsset

         Unit addAsset(Asset asset)

        Add an asset to be tracked. If the asset is already being tracked, do nothing.