19 package org.turro.contacts.relation;
21 import java.util.ArrayList;
22 import java.util.Date;
23 import java.util.HashSet;
24 import java.util.List;
25 import java.util.function.Predicate;
26 import org.amic.util.date.Dates;
27 import org.turro.contacts.BusinessRelation;
28 import org.turro.contacts.Contact;
29 import org.turro.contacts.util.ContactList;
35 public class Workers extends HashSet<BusinessRelation> {
38 private final Date now;
41 this.contact = contact;
42 this.now =
new Date();
61 return contact !=
null &&
getWorkers().contains(contact);
65 return contact !=
null &&
getWorkers(date).contains(contact);
69 return contact !=
null &&
getByCondition(predicate).contains(contact);
73 return contact !=
null &&
getByCondition(predicate, date).contains(contact);
80 public List<Contact>
getByCondition(Predicate<BusinessRelation> predicate, Date date) {
95 List<BusinessRelation> list =
new ArrayList<>();
104 private void load() {