BrightSide Workbench Full Report + Source Code
RelatedPaths.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 package org.turro.contacts;
19 
20 import java.util.Date;
21 import javax.persistence.Entity;
22 import javax.persistence.Id;
23 import javax.persistence.IdClass;
24 import javax.persistence.Temporal;
25 import org.turro.string.Strings;
26 
31 @Entity
32 @IdClass(RelatedPathsPK.class)
33 public class RelatedPaths implements java.io.Serializable {
34 
35  @Id private String origin;
36  @Id private String destination;
37 
38  private String description;
39 
40  private boolean unbreakable;
41 
42  @Temporal(value = javax.persistence.TemporalType.TIMESTAMP)
43  private java.util.Date creation;
44 
45  public Date getCreation() {
46  return creation;
47  }
48 
49  public void setCreation(Date creation) {
50  this.creation = creation;
51  }
52 
53  public String getDescription() {
54  return description;
55  }
56 
57  public void setDescription(String description) {
58  this.description = description;
59  }
60 
61  public String getDestination() {
62  return destination;
63  }
64 
65  public void setDestination(String destination) {
66  this.destination = destination;
67  }
68 
69  public String getOrigin() {
70  return origin;
71  }
72 
73  public void setOrigin(String origin) {
74  this.origin = origin;
75  }
76 
77  public boolean isUnbreakable() {
78  return unbreakable;
79  }
80 
81  public void setUnbreakable(boolean unbreakable) {
82  this.unbreakable = unbreakable;
83  }
84 
85  /* Helpers */
86 
87  public boolean isEmpty() {
88  return Strings.isBlank(origin) || Strings.isBlank(destination);
89  }
90 
91 }
void setDescription(String description)
void setCreation(Date creation)
void setDestination(String destination)
void setOrigin(String origin)
void setUnbreakable(boolean unbreakable)