Example #1
0
 public PersistentMap<K, V> include(Map<K, V> values) {
   PersistentMap<K, V> pm = this;
   for (Map.Entry<K, V> entry : values.entrySet()) {
     pm = pm.include(entry.getKey(), entry.getValue());
   }
   return pm;
 }
Example #2
0
 public PersistentMap<K, V> delete(Collection<K> keys) {
   PersistentMap<K, V> pm = this;
   for (K k : keys) {
     pm = pm.delete(k);
   }
   return pm;
 }
Example #3
0
 public boolean containsAll(PersistentMap<K, V> pm) {
   for (Map.Entry<K, V> ent : pm.entrySet()) {
     if (!containsEntry(ent)) return false;
   }
   return true;
 }
Example #4
0
 public boolean equals(PersistentMap<K, V> pm) {
   if (this == pm) return true;
   if (this.size() != pm.size()) return false;
   return this.containsAll(pm) && pm.containsAll(this);
 }