Contents
Class MapUtil
java.lang.Object
com.hypixel.hytale.common.util.MapUtil
A utility class that contains a variety of table related helper methods.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T, V, M extends Map<T,V>>
MCombines two maps into a new map using a custom map supplier.static <T,V> Map <T, V> combineUnmodifiable(Map<T, V> one, Map<T, V> two) Combines two maps into an unmodifiable map.combineUnmodifiable(Map<T, V> one, Map<T, V> two, Supplier<M> supplier) Combines two maps into an unmodifiable map using a custom map supplier.
-
Constructor Details
-
MapUtil
public MapUtil()
-
-
Method Details
-
combineUnmodifiable
@Nonnull public static <T,V> Map<T,V> combineUnmodifiable(@Nonnull Map<T, V> one, @Nonnull Map<T, V> two) Combines two maps into an unmodifiable map.- Type Parameters:
T- The type of the map keys.V- The type of the map values.- Parameters:
one- The first map.two- The second map.- Returns:
- an unmodifiable map containing all entries from both maps.
-
combineUnmodifiable
@Nonnull public static <T, V, M extends Map<T,V>> Map<T,V> combineUnmodifiable(@Nonnull Map<T, V> one, @Nonnull Map<T, V> two, @Nonnull Supplier<M> supplier) Combines two maps into an unmodifiable map using a custom map supplier.- Type Parameters:
T- The type of the map keys.V- The type of the map values.M- The type of the map.- Parameters:
one- The first map.two- The second map.supplier- The supplier to create the map.- Returns:
- an unmodifiable map containing all entries from both maps.
-
combine
@Nonnull public static <T, V, M extends Map<T,V>> M combine(@Nonnull Map<T, V> one, @Nonnull Map<T, V> two, @Nonnull Supplier<M> supplier) Combines two maps into a new map using a custom map supplier.- Type Parameters:
T- The type of the map keys.V- The type of the map values.M- The type of the map.- Parameters:
one- The first map.two- The second map.supplier- The supplier to create the map.- Returns:
- a new map containing all entries from both maps.
-