BrightSide Workbench Full Report + Source Code
org.turro.students.entities.Challenge Class Reference
Inheritance diagram for org.turro.students.entities.Challenge:
Collaboration diagram for org.turro.students.entities.Challenge:

Public Member Functions

Long getId ()
 
void setId (Long id)
 
String getEntityPath ()
 
void setEntityPath (String entityPath)
 
String getIdChallenger ()
 
void setIdChallenger (String idChallenger)
 
String getName ()
 
void setName (String name)
 
String getQuestion ()
 
void setQuestion (String question)
 
Date getCreation ()
 
void setCreation (Date creation)
 
Date getDeadline ()
 
void setDeadline (Date deadline)
 
String getText ()
 
void setText (String text)
 
String getWikiText ()
 
void setWikiText (String wikiText)
 
Set< ResponsegetResponses ()
 
void setResponses (Set< Response > responses)
 
Object entityId ()
 
boolean isEmpty ()
 
boolean removeResponse (Response response)
 
boolean isParticipant (IContact contact)
 
IElephantEntity getEntity ()
 
IContact getContact ()
 
void setContact (IContact contact)
 
MappingSet getSerializerMappings ()
 
- Public Member Functions inherited from org.turro.jpa.entity.IDaoEntity
default boolean isNew ()
 
default void prepareSave ()
 
default void prepareDelete ()
 
default void removeEmpties ()
 
default Collection< Collection > collections ()
 

Detailed Description

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

Definition at line 50 of file Challenge.java.

Member Function Documentation

◆ entityId()

Object org.turro.students.entities.Challenge.entityId ( )

Implements org.turro.jpa.entity.IDaoEntity.

Definition at line 166 of file Challenge.java.

166  {
167  return id;
168  }

◆ getContact()

IContact org.turro.students.entities.Challenge.getContact ( )

Definition at line 199 of file Challenge.java.

199  {
200  if(_contact == null) {
201  _contact = Contacts.getContactById(idChallenger);
202  }
203  return _contact;
204  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getCreation()

Date org.turro.students.entities.Challenge.getCreation ( )

Definition at line 122 of file Challenge.java.

122  {
123  return creation;
124  }
Here is the caller graph for this function:

◆ getDeadline()

Date org.turro.students.entities.Challenge.getDeadline ( )

Definition at line 130 of file Challenge.java.

130  {
131  return deadline;
132  }
Here is the caller graph for this function:

◆ getEntity()

IElephantEntity org.turro.students.entities.Challenge.getEntity ( )

Entity Helpers

Definition at line 191 of file Challenge.java.

191  {
192  return Entities.getController(entityPath);
193  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getEntityPath()

String org.turro.students.entities.Challenge.getEntityPath ( )

Definition at line 90 of file Challenge.java.

90  {
91  return entityPath;
92  }

◆ getId()

Long org.turro.students.entities.Challenge.getId ( )

Definition at line 82 of file Challenge.java.

82  {
83  return id;
84  }
Here is the caller graph for this function:

◆ getIdChallenger()

String org.turro.students.entities.Challenge.getIdChallenger ( )

Definition at line 98 of file Challenge.java.

98  {
99  return idChallenger;
100  }
Here is the caller graph for this function:

◆ getName()

String org.turro.students.entities.Challenge.getName ( )

Definition at line 106 of file Challenge.java.

106  {
107  return name;
108  }
Here is the caller graph for this function:

◆ getQuestion()

String org.turro.students.entities.Challenge.getQuestion ( )

Definition at line 114 of file Challenge.java.

114  {
115  return question;
116  }
Here is the caller graph for this function:

◆ getResponses()

Set<Response> org.turro.students.entities.Challenge.getResponses ( )

Definition at line 155 of file Challenge.java.

155  {
156  return responses;
157  }
Here is the caller graph for this function:

◆ getSerializerMappings()

MappingSet org.turro.students.entities.Challenge.getSerializerMappings ( )

Definition at line 214 of file Challenge.java.

214  {
215  MappingSet set = new MappingSet();
216  set.addMapping(Challenge.class, 1,
217  new String[] { "id", "question", "entityPath", "idChallenger", "creation", "deadline" },
218  new String[] { "wikiText", "responses" });
219  set.addMapping(Response.class, 2,
220  new String[] { "id", "creation" },
221  new String[] { "wikiText", "studentIds" });
222  return set;
223  }

◆ getText()

String org.turro.students.entities.Challenge.getText ( )

Definition at line 138 of file Challenge.java.

138  {
139  return text;
140  }
Here is the caller graph for this function:

◆ getWikiText()

String org.turro.students.entities.Challenge.getWikiText ( )

Definition at line 146 of file Challenge.java.

146  {
147  return wikiText;
148  }

◆ isEmpty()

boolean org.turro.students.entities.Challenge.isEmpty ( )

Implements org.turro.jpa.entity.IDaoEntity.

Definition at line 171 of file Challenge.java.

171  {
172  return Strings.isBlank(entityPath) || Strings.isBlank(idChallenger) ||
173  Strings.isBlank(question);
174  }
Here is the caller graph for this function:

◆ isParticipant()

boolean org.turro.students.entities.Challenge.isParticipant ( IContact  contact)

Definition at line 184 of file Challenge.java.

184  {
185  return idChallenger.equals(contact.getId()) ||
186  responses.stream().anyMatch(r -> r.getStudentIds().contains(contact.getId()));
187  }
Here is the call graph for this function:

◆ removeResponse()

boolean org.turro.students.entities.Challenge.removeResponse ( Response  response)

Helpers

Definition at line 178 of file Challenge.java.

178  {
179  EntityCollections.entities(responses).remove(response);
180  response.setChallenge(null);
181  return true;
182  }
Here is the call graph for this function:

◆ setContact()

void org.turro.students.entities.Challenge.setContact ( IContact  contact)

Definition at line 206 of file Challenge.java.

206  {
207  _contact = contact;
208  idChallenger = _contact != null ? _contact.getId() : null;
209  name = _contact != null ? _contact.getName() : null;
210  }
Here is the call graph for this function:

◆ setCreation()

void org.turro.students.entities.Challenge.setCreation ( Date  creation)

Definition at line 126 of file Challenge.java.

126  {
127  this.creation = creation;
128  }

◆ setDeadline()

void org.turro.students.entities.Challenge.setDeadline ( Date  deadline)

Definition at line 134 of file Challenge.java.

134  {
135  this.deadline = deadline;
136  }
Here is the caller graph for this function:

◆ setEntityPath()

void org.turro.students.entities.Challenge.setEntityPath ( String  entityPath)

Definition at line 94 of file Challenge.java.

94  {
95  this.entityPath = entityPath;
96  }
Here is the caller graph for this function:

◆ setId()

void org.turro.students.entities.Challenge.setId ( Long  id)

Definition at line 86 of file Challenge.java.

86  {
87  this.id = id;
88  }

◆ setIdChallenger()

void org.turro.students.entities.Challenge.setIdChallenger ( String  idChallenger)

Definition at line 102 of file Challenge.java.

102  {
103  this.idChallenger = idChallenger;
104  }

◆ setName()

void org.turro.students.entities.Challenge.setName ( String  name)

Definition at line 110 of file Challenge.java.

110  {
111  this.name = name;
112  }

◆ setQuestion()

void org.turro.students.entities.Challenge.setQuestion ( String  question)

Definition at line 118 of file Challenge.java.

118  {
119  this.question = question;
120  }
Here is the caller graph for this function:

◆ setResponses()

void org.turro.students.entities.Challenge.setResponses ( Set< Response responses)

Definition at line 159 of file Challenge.java.

159  {
160  this.responses = responses;
161  }

◆ setText()

void org.turro.students.entities.Challenge.setText ( String  text)

Definition at line 142 of file Challenge.java.

142  {
143  this.text = text;
144  }

◆ setWikiText()

void org.turro.students.entities.Challenge.setWikiText ( String  wikiText)

Definition at line 150 of file Challenge.java.

150  {
151  this.wikiText = wikiText;
152  this.text = WikiCompiler.source(this.wikiText).html();
153  }
Here is the caller graph for this function:

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