BrightSide Workbench Full Report + Source Code
org.turro.alliance.provider.Banned Class Reference

Public Member Functions

List< String > getBannedIds ()
 
boolean status (String axId)
 
boolean toggle (String axId)
 

Static Public Member Functions

static Banned of (WsMember member)
 

Detailed Description

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

Definition at line 34 of file Banned.java.

Member Function Documentation

◆ getBannedIds()

List<String> org.turro.alliance.provider.Banned.getBannedIds ( )

Definition at line 36 of file Banned.java.

36  {
37  return SqlClause.select("b").from("AxProjectBan b")
38  .where().equal("b.relation.relatedMemberId", member.getMemberId())
39  .and().isTrue("b.banned")
40  .dao(dao.get())
41  .stream(AxProjectBan.class)
42  .map(b -> b.getId())
43  .toList();
44  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ of()

static Banned org.turro.alliance.provider.Banned.of ( WsMember  member)
static

Definition at line 81 of file Banned.java.

81  {
82  return new Banned(member);
83  }
Here is the caller graph for this function:

◆ status()

boolean org.turro.alliance.provider.Banned.status ( String  axId)

Definition at line 46 of file Banned.java.

46  {
47  AxProjectBan ban = SqlClause.select("b").from("AxProjectBan b")
48  .where().equal("b.relation.relatedMemberId", member.getMemberId())
49  .and().equal("id", axId)
50  .dao(dao.get())
51  .singleResult(AxProjectBan.class);
52  return ban != null ? ban.isBanned() : false;
53  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ toggle()

boolean org.turro.alliance.provider.Banned.toggle ( String  axId)

Definition at line 55 of file Banned.java.

55  {
56  AxProjectBan ban = SqlClause.select("b").from("AxProjectBan b")
57  .where().equal("b.relation.relatedMemberId", member.getMemberId())
58  .and().equal("id", axId)
59  .dao(dao.get())
60  .singleResult(AxProjectBan.class);
61  if(ban == null) {
62  ban = new AxProjectBan();
63  ban.setRelation(new RelationId());
64  ban.setId(axId);
65  ban.getRelation().setRelatedEntityId("*");
66  ban.getRelation().setRelatedMemberId(member.getMemberId());
67  ban.setBanned(true);
68  } else {
69  ban.setBanned(!ban.isBanned());
70  }
71  ban = dao.get().saveObject(ban);
72  return ban.isBanned();
73  }
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: