-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMobile.java
42 lines (36 loc) · 1.07 KB
/
Mobile.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
package technology.touchmars.model;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import java.io.Serializable;
import java.util.Objects;
@Embeddable
public class Mobile implements Serializable {
@Column(name = "phone_no")
private String phoneNo;
@Column(name = "phone_country_code")
private Integer countryCode;
public String getPhoneNo() {
return phoneNo;
}
public void setPhoneNo(String phoneNo) {
this.phoneNo = phoneNo;
}
public Integer getCountryCode() {
return countryCode;
}
public void setCountryCode(Integer countryCode) {
this.countryCode = countryCode;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Mobile mobile = (Mobile) o;
return Objects.equals(phoneNo, mobile.phoneNo) &&
Objects.equals(countryCode, mobile.countryCode);
}
@Override
public int hashCode() {
return Objects.hash(phoneNo, countryCode);
}
}