-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUser.java
More file actions
43 lines (40 loc) · 967 Bytes
/
Copy pathUser.java
File metadata and controls
43 lines (40 loc) · 967 Bytes
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
package com.carpooling;
public class User {
public String username;
public String password;
public String fname;
public String lname;
public String mobile;
public String route;
public String stpt;
private int seats;
private String op;
private String tslot;
public int getSeats() {
return seats; //only public saved in file
}
public void setSeats(int seats) {
this.seats = seats;
}
public String getTslot() {
return tslot;
}
public void setTslot(String tslot) {
this.tslot = tslot;
}
public String getOp() {
return op;
}
public void setOp(String op) {
this.op = op;
}
@Override
public boolean equals(Object o) { //equals method override
if(null!=o&&o.getClass().equals(this.getClass())) { //ob1==ob2
User tmp =(User)o; //user type class
if(this.username.equals(tmp.username))
return true;
} //to check if user name valid
return false;
}
}