-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathuser.java
More file actions
46 lines (37 loc) · 1.15 KB
/
user.java
File metadata and controls
46 lines (37 loc) · 1.15 KB
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
package com.example.springboot;
import com.github.javafaker.Faker;
import lombok.Builder;
import lombok.Data;
import java.io.Serializable
import java.util.Locale;
@Builder
@Data
public class UserDetails implements Serializable {
protected String firstName;
protected String lastName;
protected String ssn;
protected String phoneNumber;
protected String email;
public UserDetails(String firstName, String lastName, String ssn, String phoneNumber) {
this.firstName=firstName;
this.lastName=lastName;
this.ssn=ssn;
this.phoneNumber=phoneNumber;
}
public static UserDetails randomUser() {
Faker faker = new Faker(new Locale("en-GB"));
return new UserDetails(faker.name().firstName(), faker.name().lastName(), faker.number().digits(11), faker.phoneNumber().cellPhone());
}
public static UserDetails getAdmin() {
return randomUser();
}
public static UserDetails getUser() {
return randomUser();
}
public String getName() {
return (this.firstName + " " + this.lastName);
}
public boolean validateCreds() {
return true;
}
}