Class MergedAssetView

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

    
    public final class MergedAssetView
     implements AssetView
                        

    An AssetView that merges assets from multiple views.

    Assets are combined in order: views provided first have their assets appear first. Assets are deduplicated by ID - if the same asset ID appears in multiple views, only the first occurrence is kept.

    • 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
      final static AssetView of(AssetView views) Create a MergedAssetView from multiple views, filtering out nulls.
      final static AssetView of(List<AssetView> views) Create a MergedAssetView from a list of views.
      • 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

      • MergedAssetView

        MergedAssetView(AssetView first, AssetView second)
        Convenience constructor for two views.
      • MergedAssetView

        MergedAssetView(AssetView views)
        Convenience constructor for vararg views.
      • MergedAssetView

        MergedAssetView(List<AssetView> views)
        Parameters:
        views - The AssetViews to merge, in order of priority