BrightSide Workbench Full Report + Source Code
org.turro.contacts.model.ContactModel Class Reference
Inheritance diagram for org.turro.contacts.model.ContactModel:
Collaboration diagram for org.turro.contacts.model.ContactModel:

Public Member Functions

 ContactModel (Dao dao, Collection< String > contactIds)
 
 ContactModel (Dao dao, ContactItem selected)
 
List< ContactItemgetSelectedOrAll ()
 
List< ContactItemgetSelected ()
 
void selectAll ()
 
void deselectAll ()
 
void toggleSelection ()
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 31 of file ContactModel.java.

Constructor & Destructor Documentation

◆ ContactModel() [1/2]

org.turro.contacts.model.ContactModel.ContactModel ( Dao  dao,
Collection< String >  contactIds 
)

Definition at line 33 of file ContactModel.java.

33  {
34  boolean open = contactIds.size() == 1;
35  for(String id : contactIds) {
36  add(new ContactItem(dao, id, open));
37  }
38  }

◆ ContactModel() [2/2]

org.turro.contacts.model.ContactModel.ContactModel ( Dao  dao,
ContactItem  selected 
)

Definition at line 40 of file ContactModel.java.

40  {
41  add(new ContactItem(dao, selected.getContactId(), true));
42  }
Here is the call graph for this function:

Member Function Documentation

◆ deselectAll()

void org.turro.contacts.model.ContactModel.deselectAll ( )

Definition at line 57 of file ContactModel.java.

57  {
58  forEach(ci -> ci.setSelected(false));
59  }
Here is the caller graph for this function:

◆ getSelected()

List<ContactItem> org.turro.contacts.model.ContactModel.getSelected ( )

Definition at line 49 of file ContactModel.java.

49  {
50  return stream().filter(ci -> ci.isSelected()).collect(Collectors.toList());
51  }
Here is the caller graph for this function:

◆ getSelectedOrAll()

List<ContactItem> org.turro.contacts.model.ContactModel.getSelectedOrAll ( )

Definition at line 44 of file ContactModel.java.

44  {
45  List<ContactItem> sel = getSelected();
46  return sel.isEmpty() ? this : sel;
47  }
Here is the call graph for this function:

◆ selectAll()

void org.turro.contacts.model.ContactModel.selectAll ( )

Definition at line 53 of file ContactModel.java.

53  {
54  forEach(ci -> ci.setSelected(true));
55  }
Here is the caller graph for this function:

◆ toggleSelection()

void org.turro.contacts.model.ContactModel.toggleSelection ( )

Definition at line 61 of file ContactModel.java.

61  {
62  forEach(ci -> ci.setSelected(!ci.isSelected()));
63  }
Here is the caller graph for this function:

The documentation for this class was generated from the following file: