mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 00:11:26 +07:00
add nested stream filter recognition
This commit is contained in:
+15
@@ -0,0 +1,15 @@
|
||||
// "Replace with findFirst()" "true"
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class Main {
|
||||
class MappedField{
|
||||
List<MappedField> getLoadNames(){return null;}
|
||||
}
|
||||
|
||||
public MappedField getMappedField(final String storedName) {
|
||||
List<MappedField> persistenceFields = new ArrayList<>();
|
||||
return persistenceFields.stream().filter(mf -> mf.getLoadNames().stream().anyMatch(storedName::equals)).findFirst().orElse(null);
|
||||
}
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
// "Replace with findFirst()" "true"
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class Main {
|
||||
class MappedField{
|
||||
List<MappedField> getLoadNames(){return null;}
|
||||
}
|
||||
|
||||
public MappedField getMappedField(final String storedName) {
|
||||
List<MappedField> persistenceFields = new ArrayList<>();
|
||||
for<caret> (final MappedField mf : persistenceFields) {
|
||||
for (final String n : mf.getLoadNames()) {
|
||||
if (storedName.equals(n)) {
|
||||
return mf;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user