소스 검색

Pull up `getValue` method to AbstractTextFieldListListEntry

Mitchell Skaggs 5 년 전
부모
커밋
bf353e852e
1개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  1. 6 0
      src/main/java/me/shedaniel/clothconfig2/gui/entries/AbstractTextFieldListListEntry.java

+ 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