Class ImmutableValueMap.Builder

    • Constructor Summary

      Constructors 
      Constructor Description
      Builder()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      @NotNull ImmutableValueMap build()
      Returns a newly-created immutable map.
      @NotNull ImmutableValueMap.Builder put​(@NotNull java.lang.String key, @NotNull java.lang.Object value)
      Associates key with value in the built map.
      @NotNull ImmutableValueMap.Builder put​(@NotNull java.util.Map.Entry<java.lang.String,​java.lang.Object> entry)
      Adds the given entry to the map, making it immutable if necessary.
      @NotNull ImmutableValueMap.Builder putAll​(@NotNull java.util.Map<java.lang.String,​java.lang.Object> value)
      Associates all of the given map's keys and values in the built map.
      • Methods inherited from class java.lang.Object

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

      • Builder

        public Builder()
    • Method Detail

      • put

        @NotNull
        public @NotNull ImmutableValueMap.Builder put​(@NotNull
                                                      @NotNull java.lang.String key,
                                                      @NotNull
                                                      @NotNull java.lang.Object value)
        Associates key with value in the built map. Duplicate keys are not allowed, and will cause build() to fail.
        Parameters:
        key - Key
        value - value
        Returns:
        this
      • put

        @NotNull
        public @NotNull ImmutableValueMap.Builder put​(@NotNull
                                                      @NotNull java.util.Map.Entry<java.lang.String,​java.lang.Object> entry)
        Adds the given entry to the map, making it immutable if necessary. Duplicate keys are not allowed, and will cause build() to fail.
        Parameters:
        entry - Entry
        Returns:
        this
      • putAll

        @NotNull
        public @NotNull ImmutableValueMap.Builder putAll​(@NotNull
                                                         @NotNull java.util.Map<java.lang.String,​java.lang.Object> value)
        Associates all of the given map's keys and values in the built map. Duplicate keys are not allowed, and will cause build() to fail.
        Parameters:
        value - Value
        Returns:
        this
        Throws:
        java.lang.NullPointerException - if any key or value in map is null
      • build

        @NotNull
        public @NotNull ImmutableValueMap build()
        Returns a newly-created immutable map.
        Returns:
        ImmutableValueMap
        Throws:
        java.lang.IllegalArgumentException - if duplicate keys were added