Class ModelMapBuilder<K,​V>


  • public class ModelMapBuilder<K,​V>
    extends Object
    A Map builder for CollapsedMap and EnrichableMap instances.

    The map built will be Collapsed unless put or addCollapsed methods are called. This class should be suitable for all Map usage in model Factories and Builders.

    • Method Detail

      • newInstance

        public static <K,​V> ModelMapBuilder<K,​V> newInstance()
      • newInstance

        public static <K,​V> ModelMapBuilder<K,​V> newInstance​(Map<? extends K,​? extends V> map)
      • newExpandedInstance

        public static <K,​V> ModelMapBuilder<K,​V> newExpandedInstance()
      • addCollapsedEntries

        @Deprecated
        public ModelMapBuilder<K,​V> addCollapsedEntries​(Set<? extends K> collapsedEntries)
        Deprecated.
        since 5.10 Call addCollapsedEntries(Iterable) instead
      • copy

        public ModelMapBuilder<K,​V> copy​(@NonNull Map<? extends K,​? extends V> map)
        Store CollapsedMap/NavMap but store values of other maps, including Enrichables.

        Replaces any existing contents in this builder with the contents of the map

      • build

        public Map<K,​V> build()
        Build the map. If an expanded map method has been called last on the builder, an EnrichableMap will be returned. If not, a collapsed map will be built.
      • buildFromDelegate

        protected Map<K,​V> buildFromDelegate()
        Since:
        7.0.1