Class MapUtil

java.lang.Object
com.hypixel.hytale.common.util.MapUtil

public class MapUtil extends Object
A utility class that contains a variety of table related helper methods.
  • 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.