BrightSide Workbench Full Report + Source Code
InTouch.java
Go to the documentation of this file.
1 /*
2  * TurrĂ³ i Cutiller Foundation. License notice.
3  * Copyright (C) 2012 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.ManyToOne;
28 import javax.persistence.Temporal;
29 import org.zkoss.lang.Strings;
30 
35 @Entity
36 @org.hibernate.annotations.GenericGenerator(name = "hibernate-uuid", strategy = "uuid")
37 public class InTouch implements Serializable {
38 
39  @Id
40  @GeneratedValue(generator = "hibernate-uuid")
41  @Column(name="IDENTIFIER")
42  private String id;
43 
44  @Column(name="INTOUCH_NAME")
45  private String name;
46 
47  @Column(name="INTOUCH_PATH")
48  private String path;
49 
50  @Temporal(value = javax.persistence.TemporalType.TIMESTAMP)
51  private java.util.Date control;
52 
53  @ManyToOne
54  private Contact contact;
55 
56  @ManyToOne
57  private Address address;
58 
59  private String description;
60 
61  public String getId() {
62  return id;
63  }
64 
65  public void setId(String id) {
66  this.id = id;
67  }
68 
69  public Date getControl() {
70  return control;
71  }
72 
73  public void setControl(Date control) {
74  this.control = control;
75  }
76 
77  public String getName() {
78  return name;
79  }
80 
81  public void setName(String name) {
82  this.name = name;
83  }
84 
85  public String getPath() {
86  return path;
87  }
88 
89  public void setPath(String path) {
90  this.path = path;
91  }
92 
93  public Contact getContact() {
94  return contact;
95  }
96 
97  public void setContact(Contact contact) {
98  this.contact = contact;
99  }
100 
101  public Address getAddress() {
102  return address;
103  }
104 
105  public void setAddress(Address address) {
106  this.address = address;
107  }
108 
109  public String getDescription() {
110  return description;
111  }
112 
113  public void setDescription(String description) {
114  this.description = description;
115  }
116 
117  /* Helpers */
118 
119  public boolean isEmpty() {
120  return Strings.isBlank(path) ||
121  Strings.isBlank(name) || contact == null;
122  }
123 }
void setName(String name)
Definition: InTouch.java:81
void setContact(Contact contact)
Definition: InTouch.java:97
void setDescription(String description)
Definition: InTouch.java:113
void setId(String id)
Definition: InTouch.java:65
void setControl(Date control)
Definition: InTouch.java:73
void setAddress(Address address)
Definition: InTouch.java:105
void setPath(String path)
Definition: InTouch.java:89