BrightSide Workbench Full Report + Source Code
DescribeIt.java
Go to the documentation of this file.
1 /*
2  * TurrĂ³ i Cutiller Foundation. License notice.
3  * Copyright (C) 2013 Lluis TurrĂ³ Cutiller <http://www.turro.org/>
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU Affero General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU Affero General Public License for more details.
14  *
15  * You should have received a copy of the GNU Affero General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 package org.turro.contacts;
20 
21 import java.io.Serializable;
22 import java.util.Date;
23 import javax.persistence.Column;
24 import javax.persistence.Entity;
25 import javax.persistence.GeneratedValue;
26 import javax.persistence.Id;
27 import javax.persistence.JoinColumn;
28 import javax.persistence.Lob;
29 import javax.persistence.ManyToOne;
30 import javax.persistence.Temporal;
31 import org.turro.string.Strings;
32 
37 @Entity
38 @org.hibernate.annotations.GenericGenerator(name = "hibernate-uuid", strategy = "uuid")
39 public class DescribeIt implements Serializable {
40 
41  @Id
42  @GeneratedValue(generator = "hibernate-uuid")
43  @Column(name="IDENTIFIER")
44  private String id;
45 
46  private String describeId;
47 
48  @Column(name="COMMENTIT_PATH")
49  private String path;
50 
51  @ManyToOne
52  @JoinColumn(name="CREATOR_FK")
53  private org.turro.contacts.Contact creator;
54 
55  @Temporal(value = javax.persistence.TemporalType.TIMESTAMP)
56  private java.util.Date dateCreation;
57 
58  @Lob
59  @Column(length=4096)
60  private String body;
61 
62  @Lob
63  @Column(length=4096)
64  private String wiki;
65 
66  public String getId() {
67  return id;
68  }
69 
70  public void setId(String id) {
71  this.id = id;
72  }
73 
74  public String getDescribeId() {
75  return describeId;
76  }
77 
78  public void setDescribeId(String describeId) {
79  this.describeId = describeId;
80  }
81 
82  public String getPath() {
83  return path;
84  }
85 
86  public void setPath(String path) {
87  this.path = path;
88  }
89 
90  public Contact getCreator() {
91  return creator;
92  }
93 
94  public void setCreator(Contact creator) {
95  this.creator = creator;
96  }
97 
98  public Date getDateCreation() {
99  return dateCreation;
100  }
101 
102  public void setDateCreation(Date dateCreation) {
103  this.dateCreation = dateCreation;
104  }
105 
106  public String getBody() {
107  return body;
108  }
109 
110  public void setBody(String body) {
111  this.body = body;
112  }
113 
114  public String getWiki() {
115  if(Strings.isBlank(wiki) && !Strings.isBlank(body)) {
116  wiki = "$no_wiki\n" + body;
117  }
118  return wiki;
119  }
120 
121  public void setWiki(String wiki) {
122  this.wiki = wiki;
123  }
124 
125  /* Helpers */
126 
127  public boolean isContainsWiki() {
128  return !Strings.isBlank(wiki) || id == null || Strings.isBlank(body);
129  }
130 
131 }
void setPath(String path)
Definition: DescribeIt.java:86
void setDescribeId(String describeId)
Definition: DescribeIt.java:78
void setDateCreation(Date dateCreation)
void setCreator(Contact creator)
Definition: DescribeIt.java:94