Skip to content

Commit c51c22c

Browse files
committed
Java Assignment3 upload by HoonSubKim
1 parent ca7f7c8 commit c51c22c

18 files changed

Lines changed: 473 additions & 0 deletions

File tree

.idea/.gitignore

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/KDTBE5_Java_Assignment3.iml

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/discord.xml

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module type="JAVA_MODULE" version="4">
3+
<component name="NewModuleRootManager" inherit-compiler-output="true">
4+
<exclude-output />
5+
<content url="file://$MODULE_DIR$">
6+
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
7+
</content>
8+
<orderEntry type="jdk" jdkName="11" jdkType="JavaSDK" />
9+
<orderEntry type="sourceFolder" forTests="false" />
10+
</component>
11+
</module>
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
package me.day05.practice.practice01;
2+
3+
import me.day05.practice.practice01.constant.AuthMethod;
4+
import me.day05.practice.practice01.constant.Company;
5+
6+
import java.util.ArrayList;
7+
import java.util.Arrays;
8+
import java.util.List;
9+
import java.util.Objects;
10+
11+
public class Electronic {
12+
private String productNo;
13+
private String modelName;
14+
private Company companyName;
15+
private String dateOfDate;
16+
private AuthMethod[] authMethod;
17+
18+
public Electronic(String productNo,
19+
String modelName,
20+
Company companyName,
21+
String dateOfDate
22+
) {
23+
this.productNo = productNo;
24+
this.modelName = modelName;
25+
this.companyName = companyName;
26+
this.dateOfDate = dateOfDate;
27+
this.authMethod = new AuthMethod[10];
28+
}
29+
30+
public String getProductNo() {
31+
return productNo;
32+
}
33+
34+
public String getModelName() {
35+
return modelName;
36+
}
37+
38+
public void setModelName(String modelName) {
39+
this.modelName = modelName;
40+
}
41+
42+
public Company getCompanyName() {
43+
return companyName;
44+
}
45+
46+
public void setCompanyName(Company companyName) {
47+
this.companyName = companyName;
48+
}
49+
50+
public String getDateOfDate() {
51+
return dateOfDate;
52+
}
53+
54+
public void setDateOfDate(String dateOfDate) {
55+
this.dateOfDate = dateOfDate;
56+
}
57+
58+
public AuthMethod[] getAuthMethod() {
59+
return authMethod;
60+
}
61+
public void setAuthMethod(AuthMethod[] authMethod) {
62+
this.authMethod = authMethod;
63+
}
64+
65+
@Override
66+
public boolean equals(Object obj) {
67+
if (this == obj) return true;
68+
if (obj == null || this.getClass() != obj.getClass()) return false;
69+
70+
Electronic that = (Electronic) obj;
71+
72+
if (!Objects.equals(productNo, that.productNo)) return false;
73+
if (!Objects.equals(modelName, that.modelName)) return false;
74+
if (companyName != that.companyName) return false;
75+
return Objects.equals(dateOfDate, that.dateOfDate);
76+
}
77+
78+
@Override
79+
public int hashCode() {
80+
return Objects.hash(productNo,
81+
modelName,
82+
companyName,
83+
dateOfDate
84+
);
85+
}
86+
87+
@Override
88+
public String toString() {
89+
return "Electronic{" +
90+
"productNo='" + productNo + "'" +
91+
", modelName='" + modelName + "'" +
92+
", companyName=" + companyName +
93+
", dateOfDate='" + dateOfDate + "'" +
94+
", authMethod=" + Arrays.toString(authMethod) +
95+
'}';
96+
}
97+
}
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
package me.day05.practice.practice01;
2+
3+
import java.time.LocalDateTime;
4+
import java.util.Arrays;
5+
import java.util.Objects;
6+
7+
public class User {
8+
private String userId;
9+
private String userPassword;
10+
private String userPhoneNumber;
11+
private String userEmail;
12+
private String userBirthDate;
13+
private Electronic[] electronicDevices;
14+
private LocalDateTime registerTime;
15+
16+
public User() {
17+
this.electronicDevices = new Electronic[10];
18+
this.registerTime = LocalDateTime.now();
19+
}
20+
public User(String userId,
21+
String userPassword,
22+
String userPhoneNumber,
23+
String userEmail,
24+
String userBirthDate
25+
) {
26+
this();
27+
this.userId = userId;
28+
this.userPassword = userPassword;
29+
this.userPhoneNumber = userPhoneNumber;
30+
this.userEmail = userEmail;
31+
this.userBirthDate = userBirthDate;
32+
}
33+
34+
public String getUserId() {
35+
return userId;
36+
}
37+
38+
public void setUserId(String userId) {
39+
this.userId = userId;
40+
}
41+
42+
public String getUserPassword() {
43+
return userPassword;
44+
}
45+
46+
public void setUserPassword(String userPassword) {
47+
this.userPassword = userPassword;
48+
}
49+
50+
public String getUserPhoneNumber() {
51+
return userPhoneNumber;
52+
}
53+
54+
public void setUserPhoneNumber(String userPhoneNumber) {
55+
this.userPhoneNumber = userPhoneNumber;
56+
}
57+
58+
public String getUserEmail() {
59+
return userEmail;
60+
}
61+
62+
public void setUserEmail(String userEmail) {
63+
this.userEmail = userEmail;
64+
}
65+
66+
public String getUserBirthDate() {
67+
return userBirthDate;
68+
}
69+
70+
public void setUserBirthDate(String userBirthDate) {
71+
this.userBirthDate = userBirthDate;
72+
}
73+
74+
public LocalDateTime getRegisterTime() {
75+
return registerTime;
76+
}
77+
78+
public void setRegisterTime(LocalDateTime registerTime) {
79+
this.registerTime = registerTime;
80+
}
81+
82+
public Electronic[] getElectronicDevices() {
83+
return electronicDevices;
84+
}
85+
86+
public void setElectronicDevices(Electronic[] electronicDevices) {
87+
this.electronicDevices = electronicDevices;
88+
}
89+
90+
@Override
91+
public boolean equals(Object obj) {
92+
if (this == obj) return true;
93+
if (obj == null || this.getClass() != obj.getClass()) return false;
94+
95+
User user = (User) obj;
96+
97+
if (!Objects.equals(userId, user.userId)) return false;
98+
if (!Objects.equals(userPassword, user.userPassword)) return false;
99+
if (!Objects.equals(userPhoneNumber, user.userPhoneNumber)) return false;
100+
if (!Objects.equals(userEmail, user.userEmail)) return false;
101+
if (!Objects.equals(userBirthDate, user.userBirthDate)) return false;
102+
return Objects.equals(registerTime, user.registerTime);
103+
}
104+
105+
@Override
106+
public int hashCode() {
107+
return Objects.hash(userId,
108+
userPassword,
109+
userPhoneNumber,
110+
userEmail,
111+
userBirthDate,
112+
registerTime
113+
);
114+
}
115+
116+
@Override
117+
public String toString() {
118+
return "User{" +
119+
"userId='" + userId + "'" +
120+
", userPassword='" + userPassword + "'" +
121+
", userPhoneNumber='" + userPhoneNumber + "'" +
122+
", userEmail='" + userEmail + "'" +
123+
", userBirthDate='" + userBirthDate + "'" +
124+
", electronicDevices=" + Arrays.toString(electronicDevices) +
125+
", registerTime=" + registerTime +
126+
'}';
127+
}
128+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package me.day05.practice.practice01.constant;
2+
3+
public enum AuthMethod {
4+
FINGER_PRINT, PATTERN, PIN, FACE;
5+
}

0 commit comments

Comments
 (0)