66
77import javax .annotation .Nonnull ;
88
9- public class ProfileHint implements Serializable {
10-
11- @ Json (name = "first_name" )
12- private final String firstName ;
13- @ Json (name = "last_name" )
14- private final String lastName ;
15- @ Json (name = "email" )
16- private final String email ;
17- @ Json (name = "phone" )
18- private final String phone ;
19-
20- private ProfileHint (
21- String firstName ,
22- String lastName ,
23- String email ,
24- String phone ) {
25- this .firstName = firstName ;
26- this .lastName = lastName ;
27- this .email = email ;
28- this .phone = phone ;
29- }
30-
9+ /**
10+ * {@Link #ProfileHint} is builder to setup user's personal information like phone number, email
11+ * firstName and lastName
12+ */
13+ final public class ProfileHint implements Serializable {
14+ /**
15+ * Builder class for {@link ProfileHint}
16+ */
3117 public static class Builder {
3218 private String firstName ;
3319 private String lastName ;
3420 private String email ;
3521 private String phone ;
22+
23+ /**
24+ * Set first name
25+ *
26+ * @param firstName first name of the user
27+ */
3628 public Builder firstName (@ Nonnull String firstName ) {
3729 this .firstName = firstName ;
3830 return this ;
3931 }
4032
33+ /**
34+ * Set last name
35+ *
36+ * @param lastName last name of the user
37+ */
4138 public Builder lastName (@ Nonnull String lastName ) {
4239 this .lastName = lastName ;
4340 return this ;
4441 }
4542
43+ /**
44+ * Set email address
45+ *
46+ * @param email email address of the user
47+ */
4648 public Builder email (@ Nonnull String email ) {
4749 this .email = email ;
4850 return this ;
4951 }
5052
53+ /**
54+ * Set phone number as a string including country code
55+ *
56+ * @param phone phone number of the user
57+ */
5158 public Builder phone (@ Nonnull String phone ) {
5259 this .phone = phone ;
5360 return this ;
@@ -63,27 +70,72 @@ public ProfileHint build() {
6370 }
6471 }
6572
73+ /**
74+ * Gets the first name of the user
75+ *
76+ * @return The first name of the user if set, null otherwise
77+ */
6678 public String getFirstName () {
6779 return firstName ;
6880 }
6981
82+ /**
83+ * Gets the last name of the user
84+ *
85+ * @return The last name of the user if set, null otherwise
86+ */
7087 public String getLastName () {
7188 return lastName ;
7289 }
7390
91+ /**
92+ * Gets the email address of the user
93+ *
94+ * @return The email address of the user if set, null otherwise
95+ */
7496 public String getEmail () {
7597 return email ;
7698 }
7799
100+ /**
101+ * Gets the phone number of the user as a string including country code
102+ *
103+ * @return The phone number of the user if set, null otherwise
104+ */
78105 public String getPhone () {
79106 return phone ;
80107 }
81108
109+ /**
110+ * Returns new Builder with the current instance's properties as default values
111+ *
112+ * @return a new Builder object
113+ */
82114 public Builder newBuilder () {
83115 return new Builder ()
84116 .firstName (firstName )
85117 .lastName (lastName )
86118 .email (email )
87119 .phone (phone );
88120 }
121+
122+ @ Json (name = "first_name" )
123+ private final String firstName ;
124+ @ Json (name = "last_name" )
125+ private final String lastName ;
126+ @ Json (name = "email" )
127+ private final String email ;
128+ @ Json (name = "phone" )
129+ private final String phone ;
130+
131+ private ProfileHint (
132+ String firstName ,
133+ String lastName ,
134+ String email ,
135+ String phone ) {
136+ this .firstName = firstName ;
137+ this .lastName = lastName ;
138+ this .email = email ;
139+ this .phone = phone ;
140+ }
89141}
0 commit comments