BrightSide Workbench Full Report + Source Code
Assistant.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.assistant;
20 
21 import java.io.Serializable;
22 import java.util.Objects;
23 import org.turro.elephant.security.IUser;
24 import org.turro.plugin.contacts.IContact;
25 
30 public class Assistant implements Serializable {
31 
32  public String name, email;
33  public IContact contact;
34  public Object relationEntity;
35 
38  }
39 
40  public Assistant(String name, String email, IContact contact, Object relationEntity) {
41  this.name = name;
42  this.email = email;
43  this.contact = contact;
44  this.relationEntity = relationEntity;
45  }
46 
47  public String getName() {
48  return name;
49  }
50 
51  public String getEmail() {
52  return email;
53  }
54 
55  public IContact getContact() {
56  return contact;
57  }
58 
59  public boolean hasContact() {
60  return contact != null && contact.isValid();
61  }
62 
63  @Override
64  public int hashCode() {
65  int hash = 7;
66  hash = 67 * hash + Objects.hashCode(this.email);
67  return hash;
68  }
69 
70  @Override
71  public boolean equals(Object obj) {
72  if (obj == null) {
73  return false;
74  }
75  if (getClass() != obj.getClass()) {
76  return false;
77  }
78  final Assistant other = (Assistant) obj;
79  if (!Objects.equals(this.email, other.email)) {
80  return false;
81  }
82  return true;
83  }
84 
85 }
Assistant(IContact contact, Object relationEntity)
Definition: Assistant.java:36
boolean equals(Object obj)
Definition: Assistant.java:71
Assistant(String name, String email, IContact contact, Object relationEntity)
Definition: Assistant.java:40
static final String CONNECTOR_EMAIL
Definition: IUser.java:27