BrightSide Workbench Full Report + Source Code
elephant-dossier/src/main/java/org/turro/dossier/entity/FieldDef.java
Go to the documentation of this file.
1 /*
2  * TurrĂ³ i Cutiller Foundation. License notice.
3  * Copyright (C) 2011 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 package org.turro.dossier.entity;
19 
20 import javax.persistence.Column;
21 import javax.persistence.Entity;
22 import javax.persistence.GeneratedValue;
23 import javax.persistence.GenerationType;
24 import javax.persistence.Id;
25 import javax.persistence.ManyToOne;
26 import org.turro.string.Strings;
27 
32 @Entity
33 public class FieldDef implements java.io.Serializable {
34 
35  @Id
36  @GeneratedValue(strategy=GenerationType.IDENTITY)
37  @Column(name="IDENTIFIER")
38  private Long id;
39 
40  private String labelKey;
41 
42  private Class javaClass;
43 
44  @Column(name="FV_ORDER")
45  private int order;
46 
47  private boolean description;
48  private boolean publishable;
49 
50  @ManyToOne
51  private Category category;
52 
53  public Category getCategory() {
54  return category;
55  }
56 
57  public void setCategory(Category category) {
58  this.category = category;
59  }
60 
61  public boolean isDescription() {
62  return description;
63  }
64 
65  public void setDescription(boolean description) {
66  this.description = description;
67  }
68 
69  public Long getId() {
70  return id;
71  }
72 
73  public void setId(Long id) {
74  this.id = id;
75  }
76 
77  public Class getJavaClass() {
78  return javaClass;
79  }
80 
81  public void setJavaClass(Class javaClass) {
82  this.javaClass = javaClass;
83  }
84 
85  public String getLabelKey() {
86  return labelKey;
87  }
88 
89  public void setLabelKey(String labelKey) {
90  this.labelKey = labelKey;
91  }
92 
93  public int getOrder() {
94  return order;
95  }
96 
97  public void setOrder(int order) {
98  this.order = order;
99  }
100 
101  public boolean isPublishable() {
102  return publishable;
103  }
104 
105  public void setPublishable(boolean publishable) {
106  this.publishable = publishable;
107  }
108 
109  /* Util Stub */
110 
111  public boolean isEmpty() {
112  return Strings.isBlank(labelKey) || javaClass == null || category == null;
113  }
114 
115 }