-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathClient.java
109 lines (96 loc) · 2.54 KB
/
Client.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
package GraphicalInterface;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
/**
* This class is designed to store relevant information of the clients.
* It is later on used in order to create an ObservableList of this kind of objects and populate a TableView with information
* retrieved from a database.
*/
public class Client {
// String properties are used because the class is used to populate a table view, which requires the existence of properties.
private StringProperty name, cp, rfc, mail;
/**
* Constructor of the class
*/
public Client(){
name = null;
cp = null;
rfc = null;
mail = null;
}
/**
* Sets the value of the name
* @param name String
*/
public void setName(String name){
nameProperty().set(name);
}
/**
* Initializes the name property if it is null, and returns it.
* @return StringProperty
*/
public StringProperty nameProperty(){
if (this.name == null){
this.name = new SimpleStringProperty(this, "name");
}
return name;
}
/**
* Sets the value of the cp
* @param cp String
*/
public void setCp(String cp){
cpProperty().set(cp);
}
/**
* Initializes the cp property if it is null, and returns it.
* @return StringProperty
*/
public StringProperty cpProperty(){
if (this.cp == null){
this.cp = new SimpleStringProperty(this, "cp");
}
return cp;
}
/**
* Set the value of the rfc
* @param rfc String
*/
public void setRfc(String rfc){
rfcProperty().set(rfc);
}
/**
* Get the value of rfc
* @return String
*/
public String getRfc(){
return rfcProperty().get();
}
/**
* Initializes the rfc property if it is null, and returns it.
* @return StringProperty
*/
public StringProperty rfcProperty(){
if (this.rfc == null){
this.rfc = new SimpleStringProperty(this, "rfc");
}
return rfc;
}
/**
* Sets the value of mail
* @param mail String
*/
public void setMail(String mail){
mailProperty().set(mail);
}
/**
* Initializes the mail property if it is null, and returns it.
* @return StringProperty
*/
public StringProperty mailProperty(){
if (this.mail == null){
this.mail = new SimpleStringProperty(this, "mail");
}
return mail;
}
}