RMap<K, V> extension

on

Methods

exceptEmpty() Map<K, V?>
  • return the map without key of empty values
  • exceptNull() Map<K, V>
  • return the map without key of null values
  • exceptNullAndEmpty() Map<K, V?>
  • return the map without key of null values and empty
  • expect(List<K> keys) Map<K, V?>
  • return the map without some keys
  • flip() Map<V, K>
  • swaps the collection's keys with their corresponding values
  • only(List<K> keys) Map<K, V?>
  • return a new Map with only keys you need it
  • randomEntry() MapEntry<K, V>
    return random Entry or throw state error
    randomEntryOr(MapEntry<K, V> def) MapEntry<K, V>
    return random Entry or the default if map is empty
    randomEntryOrBuilder(MapEntry<K, V> builder()) MapEntry<K, V>
    return random Entry or the use the builder to return the key
    randomEntryOrNull() MapEntry<K, V>?
    return random Entry or null if map is Empty
    randomKey() → K
    return random key or throw state error
    randomKeyOr(K def) → K
    return random key or the default if map is empty
    randomKeyOrBuilder(K builder()) → K
    return random key or the use the builder to return the key
    randomKeyOrNull() → K?
    return random key or null if map is Empty
    randomValue() → V
    return random value or throw state error
    randomValueOr(V def) → V
    return random value or the default if map is empty
    randomValueOrBuilder(V builder()) → V
    return random value or the use the builder to return the key
    randomValueOrNull() → V?
    return random value or null if map is Empty
    whereNull() Map<K, V>
  • return a new map with the null values from the original map only