package net.spals.appbuilder.mapstore.core;

import net.spals.appbuilder.mapstore.core.model.MapStoreKey;

import java.util.Map;
import java.util.function.Predicate;

/**
 * @author tkral
 */
public interface MapStorePlugin extends MapStore {

    default Predicate<Map.Entry> isNullOrEmptyEntry() {
        return entry -> entry.getValue() == null || "".equals(entry.getValue());
    }

    default void stripKey(final MapStoreKey key, final Map<String, Object> payload) {
        // Strip out the key values from the payload (if they exist)
        payload.remove(key.getHashField());
        key.getRangeField().ifPresent(rangeField -> payload.remove(rangeField));
    }
}

@@ -38,16 +38,53 @@
 .core;%0A%0A
+import com.beust.jcommander.Strings;%0A
 import n
@@ -159,16 +159,42 @@
 il.Map;%0A
+import java.util.Objects;%0A
 import j
@@ -380,16 +380,31 @@
 ntry -%3E 
+Objects.isNull(
 entry.ge
@@ -415,29 +415,65 @@
 ue()
- == null %7C%7C %22%22.equals
+)%0A                %7C%7C Strings.isStringEmpty(String.valueOf
 (ent
@@ -486,16 +486,17 @@
 Value())
+)
 ;%0A    %7D%0A

Update null or empty check after code review