Class HeteroMap

All Implemented Interfaces:
Map<HeteroMap.Key,Object>

public class HeteroMap extends AbstractMap<HeteroMap.Key,Object>
Immutable map with heterogeneously typed entries.
  • Method Details

    • get

      @Opt public <V> V get(HeteroMap.Key<V> key)
      Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.
      Type Parameters:
      V - the type of the value
      Parameters:
      key - the key whose associated value is to be returned
      Returns:
      the value to which the specified key is mapped, or null if this map contains no mapping for the key
    • entrySet

      public Set<Map.Entry<HeteroMap.Key,Object>> entrySet()
      Specified by:
      entrySet in interface Map<HeteroMap.Key,Object>
      Specified by:
      entrySet in class AbstractMap<HeteroMap.Key,Object>
    • empty

      public static HeteroMap empty()
      Returns an empty map.
    • with

      public <V> HeteroMap with(HeteroMap.Key<V> key, @Opt V value)
      Returns a map that has the same mappings as this map, with one exception.
      Type Parameters:
      V -
      Parameters:
      key -
      value -
      Returns: