Home > Back-end >  How to get what I want
How to get what I want

Time:12-30

 
The class Data {
String s1.
String s2.
String s3.
String s4.
String s5.
The Type t;
}
Enum Type {
OK, GOOD, EXCELLENT;
}

I now have a List , there are a large amount of data, now requires the s1, s2, s3, s4, s5 EXCELLENT> same data according to the Type; GOOD> OK to take the first sort, filter, and then return List ,
Here the s1, s2, s3, s4, s5 the same notes for S (n)
If I have the following data
(S (0), OK)
(S (0), GOOD)
(S (0), EXCELLENT)
(S (1), OK)
(S (1), EXCELLENT)
(S (2), OK)
(S (2), GOOD)
(S (3), OK)
The filtered should rest
(S (0), EXCELLENT)
(S (1), EXCELLENT)
(S (2), GOOD)
(S (3), OK)
Flow can be used to solve it, is there a more efficient way, turn to the great god,
  • Related