diff --git a/src/mdo/java/WrapperList.java b/src/mdo/java/WrapperList.java index 0799336aeff5..9386d3f271b4 100644 --- a/src/mdo/java/WrapperList.java +++ b/src/mdo/java/WrapperList.java @@ -27,16 +27,21 @@ import java.util.function.Supplier; class WrapperList extends AbstractList { - private final Supplier> getter; - private final Consumer> setter; - private final Function mapper; - private final Function revMapper; + public interface SerializableConsumer extends java.util.function.Consumer, java.io.Serializable {} + public interface SerializableFunction extends java.util.function.Function, java.io.Serializable {} + public interface SerializableSupplier extends java.util.function.Supplier, java.io.Serializable {} - WrapperList(List list, Function mapper, Function revMapper) { + + private final SerializableSupplier> getter; + private final SerializableConsumer> setter; + private final SerializableFunction mapper; + private final SerializableFunction revMapper; + + WrapperList(List list, SerializableFunction mapper, SerializableFunction revMapper) { this(() -> list, null, mapper, revMapper); } - WrapperList(Supplier> getter, Consumer> setter, Function mapper, Function revMapper) { + WrapperList(SerializableSupplier> getter, SerializableConsumer> setter, SerializableFunction mapper, SerializableFunction revMapper) { this.getter = getter; this.setter = setter; this.mapper = mapper; diff --git a/src/mdo/java/WrapperProperties.java b/src/mdo/java/WrapperProperties.java index 46d7658365a4..4d9b623f64d7 100644 --- a/src/mdo/java/WrapperProperties.java +++ b/src/mdo/java/WrapperProperties.java @@ -41,10 +41,13 @@ class WrapperProperties extends Properties { - final Supplier> getter; - final Consumer setter; + public interface SerializableConsumer extends java.util.function.Consumer, java.io.Serializable {} + public interface SerializableSupplier extends java.util.function.Supplier, java.io.Serializable {} - WrapperProperties(Supplier> getter, Consumer setter) { + final SerializableSupplier> getter; + final SerializableConsumer setter; + + WrapperProperties(SerializableSupplier> getter, SerializableConsumer setter) { this.getter = getter; this.setter = setter; }