BrightSide Workbench Full Report + Source Code
TargetItem.java
Go to the documentation of this file.
1 /*
2  * TurrĂ³ i Cutiller Foundation. License notice.
3  * Copyright (C) 2013 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.organigram;
20 
21 import java.io.Serializable;
22 
27 public class TargetItem implements Serializable {
28 
29  private RelationType relationType;
30  private String description;
31  private NextOperator nextOperator;
32 
34  return relationType;
35  }
36 
37  public void setRelationType(RelationType relationType) {
38  this.relationType = relationType;
39  if(nextOperator == null) {
40  nextOperator = NextOperator.NO_OTHERWISE;
41  }
42  }
43 
44  public String getDescription() {
45  return description;
46  }
47 
48  public void setDescription(String description) {
49  this.description = description;
50  }
51 
53  return nextOperator;
54  }
55 
56  public void setNextOperator(NextOperator nextOperator) {
57  this.nextOperator = nextOperator;
58  }
59 
60  @Override
61  public int hashCode() {
62  int hash = 5;
63  hash = 67 * hash + (this.relationType != null ? this.relationType.hashCode() : 0);
64  hash = 67 * hash + (this.description != null ? this.description.hashCode() : 0);
65  return hash;
66  }
67 
68  @Override
69  public boolean equals(Object obj) {
70  if (obj == null) {
71  return false;
72  }
73  if (getClass() != obj.getClass()) {
74  return false;
75  }
76  final TargetItem other = (TargetItem) obj;
77  if (this.relationType != other.relationType) {
78  return false;
79  }
80  if ((this.description == null) ? (other.description != null) : !this.description.equals(other.description)) {
81  return false;
82  }
83  return true;
84  }
85 
86 }
void setNextOperator(NextOperator nextOperator)
Definition: TargetItem.java:56
void setDescription(String description)
Definition: TargetItem.java:48
void setRelationType(RelationType relationType)
Definition: TargetItem.java:37