BrightSide Workbench Full Report + Source Code
org.turro.elephant.entities.db.Post Class Reference
Inheritance diagram for org.turro.elephant.entities.db.Post:
Collaboration diagram for org.turro.elephant.entities.db.Post:

Public Member Functions

Long getId ()
 
void setId (Long id)
 
Topic getTopic ()
 
void setTopic (Topic topic)
 
Post getParent ()
 
void setParent (Post parent)
 
String getUniquePath ()
 
void setUniquePath (String uniquePath)
 
String getAuthorId ()
 
void setAuthorId (String authorId)
 
Date getCreation ()
 
void setCreation (Date creation)
 
String getText ()
 
void setText (String text)
 
boolean isEmpty ()
 
IUniquePath getCurrentParent ()
 
Topic getParentTopic ()
 
List< PostgetPosts ()
 
List< PostgetPosts (Dao dao)
 
boolean isSeen ()
 
boolean isSeen (IContact contact)
 
IContact getContact ()
 
ITreeEntity getEntityParent ()
 
Collection< ITreeEntitygetEntityChildren ()
 

Detailed Description

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

Definition at line 55 of file Post.java.

Member Function Documentation

◆ getAuthorId()

String org.turro.elephant.entities.db.Post.getAuthorId ( )

Definition at line 112 of file Post.java.

112  {
113  return authorId;
114  }
Here is the caller graph for this function:

◆ getContact()

IContact org.turro.elephant.entities.db.Post.getContact ( )

Definition at line 181 of file Post.java.

181  {
182  return Contacts.getContactById(authorId);
183  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getCreation()

Date org.turro.elephant.entities.db.Post.getCreation ( )

Definition at line 120 of file Post.java.

120  {
121  return creation;
122  }
Here is the caller graph for this function:

◆ getCurrentParent()

IUniquePath org.turro.elephant.entities.db.Post.getCurrentParent ( )

Definition at line 143 of file Post.java.

143  {
144  if(parent == null) {
145  return topic;
146  } else {
147  return parent;
148  }
149  }
Here is the caller graph for this function:

◆ getEntityChildren()

Collection<ITreeEntity> org.turro.elephant.entities.db.Post.getEntityChildren ( )

Implements org.turro.entities.ITreeEntity.

Definition at line 206 of file Post.java.

206  {
207  return new ArrayList<>(getPosts());
208  }

◆ getEntityParent()

ITreeEntity org.turro.elephant.entities.db.Post.getEntityParent ( )

Implements org.turro.entities.ITreeEntity.

Definition at line 201 of file Post.java.

201  {
202  return (ITreeEntity) getCurrentParent();
203  }

◆ getId()

Long org.turro.elephant.entities.db.Post.getId ( )

Definition at line 79 of file Post.java.

79  {
80  return id;
81  }
Here is the caller graph for this function:

◆ getParent()

Post org.turro.elephant.entities.db.Post.getParent ( )

Definition at line 95 of file Post.java.

95  {
96  return parent;
97  }
Here is the caller graph for this function:

◆ getParentTopic()

Topic org.turro.elephant.entities.db.Post.getParentTopic ( )

Definition at line 151 of file Post.java.

151  {
152  Post post = this;
153  while(post != null && post.getTopic() == null) {
154  post = post.getParent();
155  }
156  return post != null ? post.getTopic() : null;
157  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getPosts() [1/2]

List<Post> org.turro.elephant.entities.db.Post.getPosts ( )

Definition at line 159 of file Post.java.

159  {
160  return getPosts(new ElephantPU());
161  }
Here is the caller graph for this function:

◆ getPosts() [2/2]

List<Post> org.turro.elephant.entities.db.Post.getPosts ( Dao  dao)

Definition at line 163 of file Post.java.

163  {
164  WhereClause wc = new WhereClause();
165  wc.addClause("select p from Post p");
166  wc.addClause("where p.parent = :post");
167  wc.addNamedValue("post", this);
168  wc.addClause("order by creation");
169  return dao.getResultList(wc);
170  }
Here is the call graph for this function:

◆ getText()

String org.turro.elephant.entities.db.Post.getText ( )

Definition at line 128 of file Post.java.

128  {
129  return text;
130  }

◆ getTopic()

Topic org.turro.elephant.entities.db.Post.getTopic ( )

Definition at line 87 of file Post.java.

87  {
88  return topic;
89  }
Here is the caller graph for this function:

◆ getUniquePath()

String org.turro.elephant.entities.db.Post.getUniquePath ( )

Implements org.turro.entities.IUniquePath.

Definition at line 104 of file Post.java.

104  {
105  return uniquePath;
106  }

◆ isEmpty()

boolean org.turro.elephant.entities.db.Post.isEmpty ( )

Definition at line 138 of file Post.java.

138  {
139  return Strings.isBlank(text) || Strings.isBlank(authorId) ||
140  (parent == null && topic == null);
141  }

◆ isSeen() [1/2]

boolean org.turro.elephant.entities.db.Post.isSeen ( )

Definition at line 172 of file Post.java.

172  {
173  return isSeen(Authentication.getIContact());
174  }
Here is the call graph for this function:

◆ isSeen() [2/2]

boolean org.turro.elephant.entities.db.Post.isSeen ( IContact  contact)

Definition at line 176 of file Post.java.

176  {
177  return new ParticipationInfo("/post/" + getId(), "/contact/" + contact.getId(),
178  ParticipationReason.REASON_SEEN).isChecked();
179  }
Here is the call graph for this function:

◆ setAuthorId()

void org.turro.elephant.entities.db.Post.setAuthorId ( String  authorId)

Definition at line 116 of file Post.java.

116  {
117  this.authorId = authorId;
118  }
Here is the caller graph for this function:

◆ setCreation()

void org.turro.elephant.entities.db.Post.setCreation ( Date  creation)

Definition at line 124 of file Post.java.

124  {
125  this.creation = creation;
126  }
Here is the caller graph for this function:

◆ setId()

void org.turro.elephant.entities.db.Post.setId ( Long  id)

Definition at line 83 of file Post.java.

83  {
84  this.id = id;
85  }

◆ setParent()

void org.turro.elephant.entities.db.Post.setParent ( Post  parent)

Definition at line 99 of file Post.java.

99  {
100  this.parent = parent;
101  }

◆ setText()

void org.turro.elephant.entities.db.Post.setText ( String  text)

Definition at line 132 of file Post.java.

132  {
133  this.text = text;
134  }
Here is the caller graph for this function:

◆ setTopic()

void org.turro.elephant.entities.db.Post.setTopic ( Topic  topic)

Definition at line 91 of file Post.java.

91  {
92  this.topic = topic;
93  }
Here is the caller graph for this function:

◆ setUniquePath()

void org.turro.elephant.entities.db.Post.setUniquePath ( String  uniquePath)

Definition at line 108 of file Post.java.

108  {
109  this.uniquePath = uniquePath;
110  }

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