Package net.kyori.adventure.util
Interface InheritanceAwareMap.Builder<C,V>
-
- Type Parameters:
C
- the class typeV
- the value type
- All Superinterfaces:
AbstractBuilder<InheritanceAwareMap<C,V>>
- Enclosing interface:
- InheritanceAwareMap<C,V>
public static interface InheritanceAwareMap.Builder<C,V> extends AbstractBuilder<InheritanceAwareMap<C,V>>
A builder for inheritance-aware maps.- Since:
- 4.17.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description @NotNull InheritanceAwareMap.Builder<C,V>
put(@NotNull java.lang.Class<? extends C> clazz, V value)
Put another value in this map.@NotNull InheritanceAwareMap.Builder<C,V>
putAll(@NotNull InheritanceAwareMap<? extends C,? extends V> map)
Put values from an existing inheritance-aware map into this map.@NotNull InheritanceAwareMap.Builder<C,V>
remove(@NotNull java.lang.Class<? extends C> clazz)
Remove a value in this map.@NotNull InheritanceAwareMap.Builder<C,V>
strict(boolean strict)
Set strict mode for this builder.-
Methods inherited from interface net.kyori.adventure.builder.AbstractBuilder
build
-
-
-
-
Method Detail
-
strict
@NotNull @NotNull InheritanceAwareMap.Builder<C,V> strict(boolean strict)
Set strict mode for this builder.If this builder has values from when it was not in strict mode, all previous values will be re-validated for any hierarchy ambiguities.
- Parameters:
strict
- whether to enable strict mode.- Returns:
- this builder
- Since:
- 4.17.0
-
put
@NotNull @NotNull InheritanceAwareMap.Builder<C,V> put(@NotNull @NotNull java.lang.Class<? extends C> clazz, @NotNull V value)
Put another value in this map.- Parameters:
clazz
- the class typevalue
- the value for the provided type and any subtypes- Returns:
- this builder
- Since:
- 4.17.0
-
remove
@NotNull @NotNull InheritanceAwareMap.Builder<C,V> remove(@NotNull @NotNull java.lang.Class<? extends C> clazz)
Remove a value in this map.- Parameters:
clazz
- the class type- Returns:
- this builder
- Since:
- 4.17.0
-
putAll
@NotNull @NotNull InheritanceAwareMap.Builder<C,V> putAll(@NotNull @NotNull InheritanceAwareMap<? extends C,? extends V> map)
Put values from an existing inheritance-aware map into this map.- Parameters:
map
- the existing map- Returns:
- this builder
- Since:
- 4.17.0
-
-