Skip to content
This repository was archived by the owner on Feb 3, 2025. It is now read-only.

Commit 01e1f89

Browse files
update method getDataList(clazz) in HanGuiBuilder.java
1 parent c7b2f20 commit 01e1f89

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

src/main/java/tech/bingulhan/hanguiapi/gui/HanGuiBuilder.java

+2-10
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import tech.bingulhan.hanguiapi.gui.item.GuiItem;
2121

2222
import java.util.*;
23+
import java.util.stream.Collectors;
2324

2425
/**
2526
* @author BingulHan
@@ -115,16 +116,7 @@ public List<GuiData> getDataList() {
115116
}
116117

117118
public <T> List<GuiData<T>> getDataList(Class<T> type) {
118-
List<GuiData<T>> result = new ArrayList<>();
119-
dataList.forEach(guiData -> {
120-
121-
if (guiData.getT().getClass().equals(type)) {
122-
result.add(guiData);
123-
}
124-
125-
});
126-
127-
return result;
119+
return dataList.stream().filter(guiData -> guiData.getT().equals(type)).collect(Collectors.toList());
128120

129121
}
130122

0 commit comments

Comments
 (0)