-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUser.java
More file actions
66 lines (51 loc) · 1.58 KB
/
User.java
File metadata and controls
66 lines (51 loc) · 1.58 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
package com.example.nfcapp.BCardObject;
import static android.provider.ContactsContract.CommonDataKinds.StructuredName.*;
import java.lang.reflect.Array;
import java.util.ArrayList;
public class User {
private int id;
private String prefix;
private String firstName;
private String middleName;
private String lastName;
private String suffix;
private ArrayList<String> phoneNumber = new ArrayList<>();
public User(int id, String prefix, String firstName, String middleName, String lastName, String suffix) {
this.id = id;
this.prefix = prefix;
this.firstName = firstName;
this.middleName = middleName;
this.lastName = lastName;
this.suffix = suffix;
}
public User() {
}
void put(String TYPE, int input) {
switch(TYPE) {
case CONTACT_ID :
this.id = input;
break;
default:
throw new TypeNotPresentException(TYPE, new Throwable("exception thrown in com.example.nfcapp.BCardObject.User"));
}
}
void put(String TYPE, String input) {
switch (TYPE) {
case PREFIX:
this.prefix = input;
break;
case GIVEN_NAME:
this.firstName = input;
break;
case MIDDLE_NAME:
this.middleName = input;
break;
case FAMILY_NAME:
this.lastName = input;
break;
case SUFFIX:
this.suffix = input;
break;
}
}
}