Refactor io.ebeaninternal.json.ModifyAwareOwner to io.ebean.ModifyAwareType

- Rename ModifyAwareOwner to ModifyAwareType
- Move to io.ebean (making it properly public)
- Remove the requirement for Serializable
- Simplify to effectively a getter/setter pair (dirty state flag)
- Simplify to reset the dirty state flag via
This commit is contained in:
rob bygrave committed 2020-11-19 21:50:29 +13:00
1 parent fb3fd439bb
commit dcfada0b52
19 files changed
+314 -90

No files matched your search

@@ -2,7 +2,7 @@ package io.ebean.json;
import io.ebean.text.json.EJson;
import io.ebeaninternal.json.ModifyAwareMap;
import io.ebeaninternal.json.ModifyAwareOwner;
import io.ebean.ModifyAwareType;
import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.core.JsonParser;
import org.junit.Test;
@@ -293,7 +293,7 @@ public class EJsonTests {
Set set = EJson.parseSet(jsonInput, true);
ModifyAwareOwner modAware = (ModifyAwareOwner) set;
ModifyAwareType modAware = (ModifyAwareType) set;
assertFalse(modAware.isMarkedDirty());
Iterator iterator = set.iterator();
@@ -59,7 +59,7 @@ public class ModifyAwareMapTest {
ModifyAwareMap<String, String> map = createMap();
assertFalse(map.isMarkedDirty());
map.markAsModified();
map.setMarkedDirty(true);
Assert.assertTrue(map.isMarkedDirty());
}
@@ -20,7 +20,7 @@ public class ModifyAwareFlagTest {
ObjectOutputStream oos = new ObjectOutputStream(os);
ModifyAwareFlag flag = new ModifyAwareFlag();
flag.markAsModified();
flag.setMarkedDirty(true);
oos.writeObject(flag);
oos.flush();
oos.close();