BrightSide Workbench Full Report + Source Code
FieldIt.java
Go to the documentation of this file.
1 /*
2  * TurrĂ³ i Cutiller Foundation. License notice.
3  * Copyright (C) 2014 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 javax.persistence.Column;
23 import javax.persistence.Entity;
24 import javax.persistence.GeneratedValue;
25 import javax.persistence.Id;
26 import org.turro.string.Strings;
27 
32 @Entity
33 @org.hibernate.annotations.GenericGenerator(name = "hibernate-uuid", strategy = "uuid")
34 public class FieldIt implements Serializable {
35 
36  @Id
37  @GeneratedValue(generator = "hibernate-uuid")
38  @Column(name="IDENTIFIER")
39  private String id;
40 
41  @Column(name="FIELDIT_NAME")
42  private String name;
43 
44  @Column(name="FLIEDIT_PATH")
45  private String path;
46 
47  private Class javaClass;
48 
49  @Column(name="FILEDIT_ORDER")
50  private int order;
51 
52  private boolean description;
53  private boolean publishable;
54  private boolean composite;
55  private boolean searchable;
56 
57  public String getId() {
58  return id;
59  }
60 
61  public void setId(String id) {
62  this.id = id;
63  }
64 
65  public String getName() {
66  return name;
67  }
68 
69  public void setName(String name) {
70  this.name = name;
71  }
72 
73  public String getPath() {
74  return path;
75  }
76 
77  public void setPath(String path) {
78  this.path = path;
79  }
80 
81  public Class getJavaClass() {
82  return javaClass;
83  }
84 
85  public void setJavaClass(Class javaClass) {
86  this.javaClass = javaClass;
87  }
88 
89  public int getOrder() {
90  return order;
91  }
92 
93  public void setOrder(int order) {
94  this.order = order;
95  }
96 
97  public boolean isDescription() {
98  return description;
99  }
100 
101  public void setDescription(boolean description) {
102  this.description = description;
103  }
104 
105  public boolean isPublishable() {
106  return publishable;
107  }
108 
109  public void setPublishable(boolean publishable) {
110  this.publishable = publishable;
111  }
112 
113  public boolean isComposite() {
114  return composite;
115  }
116 
117  public void setComposite(boolean composite) {
118  this.composite = composite;
119  }
120 
121  public boolean isSearchable() {
122  return searchable;
123  }
124 
125  public void setSearchable(boolean searchable) {
126  this.searchable = searchable;
127  }
128 
129  /* Helpers */
130 
131  public boolean isValid() {
132  return !Strings.isBlank(name) &&
133  !Strings.isBlank(path) &&
134  javaClass != null;
135  }
136 
137  public ValueIt createValue() {
138  ValueIt v = new ValueIt();
139  v.setFieldIt(this);
140  return v;
141  }
142 
143 }
void setName(String name)
Definition: FieldIt.java:69
void setOrder(int order)
Definition: FieldIt.java:93
void setComposite(boolean composite)
Definition: FieldIt.java:117
void setDescription(boolean description)
Definition: FieldIt.java:101
void setSearchable(boolean searchable)
Definition: FieldIt.java:125
void setPath(String path)
Definition: FieldIt.java:77
void setId(String id)
Definition: FieldIt.java:61
void setPublishable(boolean publishable)
Definition: FieldIt.java:109
void setJavaClass(Class javaClass)
Definition: FieldIt.java:85
void setFieldIt(FieldIt fieldIt)
Definition: ValueIt.java:78