У меня есть следующий список объектов клиентов:
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
public class CheckForResource {
public static void main(String[] args) {
Customer john = new Customer("111", "P_1", "daily",
"create", "table_1", "03-05-2020",
"03-05-2020", "140");
Customer mary = new Customer("111", "P_1", "daily",
"delete", "table_1", "03-05-2020",
"03-05-2020", "30");
Customer joseph = new Customer("222", "P_2", "weekly",
"create", "table_2", "03-05-2020",
"03-05-2020", "50");
Customer jason = new Customer("222", "P_2", "daily",
"update", "table_2", "03-05-2020",
"03-05-2020", "40");
Customer mario = new Customer("111", "P_1", "weekly",
"create", "table_1", "03-05-2020",
"03-05-2020", "20");
Customer danny = new Customer("111", "P_1", "monthly",
"update", "table_1", "03-05-2020",
"03-05-2020", "100");
List<CheckForResource.Customer> customers = Arrays.asList(john, mary, joseph, jason, mario, danny);
}
public static class Customer {
final String Id;
final String pCode;
final String usageType;
final String operation;
final String resource;
final String startTime;
final String endTime;
final String value;
public Customer(String id, String pCode, String usageType, String operation,
String resource, String startTime, String endTime, String value) {
Id = id;
this.pCode = pCode;
this.usageType = usageType;
this.operation = operation;
this.resource = resource;
this.startTime = startTime;
this.endTime = endTime;
this.value = value;
}
}
}
Я хочу вернуть истину, если в списке есть хотя бы 1 запись каждого из следующих пунктов
- customerId = "111", operation = "create", usageType = "daily"
- customerId = "111", operation = "create", usageType = "ежемесячно"
- customerId = "111" , operation = "delete", usageType = "daily"
- customerId = "111", operation = "delete", usageType = "month"
- customerId = "111", operation = " update ", usageType =" daily "
- customerId =" 111 ", operation =" update ", usageType =" month "
Как добиться этого с помощью Steam?