Class ConfiguredMap<K,V>

All Implemented Interfaces:
Map<K,V>

public class ConfiguredMap<K,V> extends CachedConfigValue<Map<K,V>,V> implements Map<K,V>
  • Field Details Link icon

    • constructor Link icon

      @NotNull protected final @NotNull Supplier<? extends Map<K,V>> constructor
    • keyAdapter Link icon

      @NotNull protected final @NotNull ValueAdapter<K> keyAdapter
    • valueAdapter Link icon

      @NotNull protected final @NotNull ValueAdapter<V> valueAdapter
  • Constructor Details Link icon

  • Method Details Link icon

    • builderOf Link icon

      public static <V> ConfigMapCreator<String,V> builderOf(@NotNull @NotNull Class<V> valueType)
    • builderOf Link icon

      public static <K, V> ConfigMapCreator<K,V> builderOf(@NotNull @NotNull ValueType<K> keyType, @NotNull @NotNull ValueType<V> valueType)
    • builderOf Link icon

      public static <K, V> ConfigMapCreator<K,V> builderOf(@NotNull @NotNull Class<K> keyType, @NotNull @NotNull Class<V> valueType)
    • of Link icon

      public static <K, V> ConfiguredMap<K,V> of(@NotNull @NotNull Supplier<? extends Map<K,V>> constructor, @NotNull @NotNull ValueAdapter<K> keyAdapter, @NotNull @NotNull ValueAdapter<V> valueAdapter)
    • keyAdapter Link icon

      @NotNull public @NotNull ValueAdapter<K> keyAdapter()
    • keyType Link icon

      @NotNull public @NotNull ValueType<K> keyType()
    • valueAdapter Link icon

      @NotNull public @NotNull ValueAdapter<V> valueAdapter()
    • valueType Link icon

      @NotNull public @NotNull ValueType<V> valueType()
    • get Link icon

      @NotNull public @NotNull Map<K,V> get()
      Description copied from class: ConfigValue
      Gets the configured value (i.e., the value read from the source).
      If no default value was written during initialization, you can use the ConfigValue.getOrDefault() method to obtain the default value when this value is empty.
      Specified by:
      get in class ConfigValue<Map<K,V>,V>
      Returns:
      Configured value
    • get Link icon

      public V get(Object key)
      Specified by:
      get in interface Map<K,V>
    • getNotNull Link icon

      public V getNotNull(@Nullable K key)
    • set Link icon

      public void set(@Nullable @Nullable Map<K,V> value)
      Description copied from class: ConfigValue
      Sets the value of this configuration.
      After setting, the configuration file will NOT be saved automatically. To save, call ConfigurationHolder.save().
      Specified by:
      set in class ConfigValue<Map<K,V>,V>
      Parameters:
      value - The value to set
    • handle Link icon

      @NotNull public <T> T handle(Function<Map<K,V>,T> function)
    • modify Link icon

      @NotNull public @NotNull ConfiguredMap<K,V> modify(Consumer<Map<K,V>> consumer)
    • size Link icon

      public int size()
      Specified by:
      size in interface Map<K,V>
    • isEmpty Link icon

      public boolean isEmpty()
      Specified by:
      isEmpty in interface Map<K,V>
    • containsKey Link icon

      public boolean containsKey(Object key)
      Specified by:
      containsKey in interface Map<K,V>
    • containsValue Link icon

      public boolean containsValue(Object value)
      Specified by:
      containsValue in interface Map<K,V>
    • put Link icon

      @Nullable public V put(K key, V value)
      Specified by:
      put in interface Map<K,V>
    • remove Link icon

      public V remove(Object key)
      Specified by:
      remove in interface Map<K,V>
    • putAll Link icon

      public void putAll(@NotNull @NotNull Map<? extends K,? extends V> m)
      Specified by:
      putAll in interface Map<K,V>
    • clear Link icon

      public void clear()
      Specified by:
      clear in interface Map<K,V>
    • keySet Link icon

      @NotNull public @NotNull Set<K> keySet()
      Specified by:
      keySet in interface Map<K,V>
    • values Link icon

      @NotNull public @NotNull Collection<V> values()
      Specified by:
      values in interface Map<K,V>
    • entrySet Link icon

      @NotNull public @NotNull @Unmodifiable Set<Map.Entry<K,V>> entrySet()
      Specified by:
      entrySet in interface Map<K,V>