BrightSide Workbench Full Report + Source Code
org.turro.contacts.profile.ProfilePolicies Class Reference

Public Member Functions

 ProfilePolicies (Contact contact)
 
void setPolicy (Object obj, String element, PublishPolicy publish)
 
PublishPolicy getPolicy (Object obj, String element)
 
void save ()
 

Detailed Description

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

Definition at line 36 of file ProfilePolicies.java.

Constructor & Destructor Documentation

◆ ProfilePolicies()

org.turro.contacts.profile.ProfilePolicies.ProfilePolicies ( Contact  contact)

Definition at line 41 of file ProfilePolicies.java.

41  {
42  this.contact = contact;
43  policies = new HashSet<>();
44  load();
45  }

Member Function Documentation

◆ getPolicy()

PublishPolicy org.turro.contacts.profile.ProfilePolicies.getPolicy ( Object  obj,
String  element 
)

Definition at line 55 of file ProfilePolicies.java.

55  {
56  String entityPath = createPathFrom(obj, element);
57  return policies.stream().filter(pp -> pp.getProfilePath().equals(entityPath))
58  .map(pp -> pp.getPublish())
59  .findFirst().orElse(getDefaultFor(element));
60  }
Here is the caller graph for this function:

◆ save()

void org.turro.contacts.profile.ProfilePolicies.save ( )

Definition at line 62 of file ProfilePolicies.java.

62  {
63  Dao dao = new ContactsPU();
64  removeFromContact(dao);
65  dao.saveEntities(policies);
66  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setPolicy()

void org.turro.contacts.profile.ProfilePolicies.setPolicy ( Object  obj,
String  element,
PublishPolicy  publish 
)

Definition at line 47 of file ProfilePolicies.java.

47  {
48  ProfilePolicy pp = new ProfilePolicy();
49  pp.setProfilePath(createPathFrom(obj, element));
50  pp.setPublish(publish);
51  if(policies.contains(pp)) policies.remove(pp);
52  policies.add(pp);
53  }
Here is the call graph for this function:
Here is the caller graph for this function:

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