BrightSide Workbench Full Report + Source Code
OldRelatedEntry.java
Go to the documentation of this file.
1 /*
2  * TurrĂ³ i Cutiller Foundation. License notice.
3  * Copyright (C) 2022 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.related;
20 
21 import java.util.Date;
22 import org.turro.elephant.entities.db.Related;
23 import org.turro.jpa.Dao;
24 
29 public class OldRelatedEntry {
30 
31  private final String origin, destination, description;
32  private final boolean unbreakable;
33  private final Date creation;
34 
35  public OldRelatedEntry(String origin, String destination, String description, boolean unbreakable, Date creation) {
36  this.origin = origin;
37  this.destination = destination;
38  this.description = description;
39  this.unbreakable = unbreakable;
40  this.creation = creation;
41  }
42 
43  public String getOrigin() {
44  return origin;
45  }
46 
47  public String getDestination() {
48  return destination;
49  }
50 
51  public String getDescription() {
52  return description;
53  }
54 
55  public boolean isUnbreakable() {
56  return unbreakable;
57  }
58 
59  public Date getCreation() {
60  return creation;
61  }
62 
63  public void migrate(Dao dao) {
64  Related related = new Related();
65  related.setCreation(creation);
66  related.setDescription(description);
67  related.setDestination(destination);
68  related.setOrigin(origin);
69  related.setUnbreakable(unbreakable);
70  dao.saveObject(related);
71  }
72 
73 }
void setDestination(String destination)
Definition: Related.java:68
void setUnbreakable(boolean unbreakable)
Definition: Related.java:84
void setDescription(String description)
Definition: Related.java:60
OldRelatedEntry(String origin, String destination, String description, boolean unbreakable, Date creation)