Browse Source

Pull up `getValue` method to AbstractTextFieldListListEntry

Mitchell Skaggs 5 years ago
parent
commit
bf353e852e

+ 6 - 0
src/main/java/me/shedaniel/clothconfig2/gui/entries/AbstractTextFieldListListEntry.java

@@ -14,6 +14,7 @@ import java.util.Optional;
 import java.util.function.BiFunction;
 import java.util.function.Consumer;
 import java.util.function.Supplier;
+import java.util.stream.Collectors;
 
 /**
  * This class represents config entry lists that use one {@link TextFieldWidget} per entry.
@@ -43,6 +44,11 @@ public abstract class AbstractTextFieldListListEntry<T, C extends AbstractTextFi
         super(fieldName, value, defaultExpanded, tooltipSupplier, saveConsumer, defaultValue, resetButtonKey, requiresRestart, deleteButtonEnabled, insertInFront, createNewCell);
     }
 
+    @Override
+    public List<T> getValue() {
+        return cells.stream().map(C::getValue).collect(Collectors.toList());
+    }
+
     /**
      * @param <T>           the configuration object type
      * @param <SELF>        the "curiously recurring template pattern" type parameter for this class