feat: add StringParser and reworking project structure

This commit is contained in:
Ершов Владислав
2026-08-24 22:54:19 +07:00
parent 808e1eadbb
commit 8fa66b10d2
12 changed files with 82 additions and 103 deletions
@@ -0,0 +1,20 @@
package ru.project.datasource;
import ru.project.student.Student;
import ru.project.student.StudentBuilder;
import ru.project.collection.MyList;
public class StringParser {
public static Student parseString(String str){
String [] parts = str.split(";");
try{
return new StudentBuilder()
.setGroupNumber(parts[0])
.setAverageGrade(Double.valueOf(parts[1]))
.setRecordBookNumber(parts[2])
.build();
}catch(NumberFormatException e){
return null;
}
}
}