Skip to content
Open

done #37

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions Answers/Library/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/

### IntelliJ IDEA ###
.idea/modules.xml
.idea/jarRepositories.xml
.idea/compiler.xml
.idea/libraries/
*.iws
*.iml
*.ipr

### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/

### VS Code ###
.vscode/

### Mac OS ###
.DS_Store
3 changes: 3 additions & 0 deletions Answers/Library/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Answers/Library/.idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions Answers/Library/.idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions Answers/Library/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions Answers/Library/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions Answers/Library/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>org.example</groupId>
<artifactId>Library</artifactId>
<version>1.0-SNAPSHOT</version>

<properties>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

</project>
33 changes: 33 additions & 0 deletions Answers/Library/src/main/java/Admin.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import java.io.Serial;
import java.io.Serializable;
import java.util.UUID;

public class Admin extends Person implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
private String password;
static int currentID = 0;

public Admin(String fullName, String phoneNumber, String password) {
super(fullName, phoneNumber);
currentID ++;
this.ID = String.valueOf(currentID);
this.password = password;
}
public String getPassword(){
return password;
}

public void setPassword(String password) {
this.password = password;
}

@Override
public String toString() {
return "Admin{" +
"fullName='" + getFullName() + '\'' +
", ID='" + getID() + '\'' +
", phoneNumber='" + getPhoneNumber() + '\'' +
'}';
}
}
69 changes: 69 additions & 0 deletions Answers/Library/src/main/java/Book.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import java.io.Serial;
import java.util.UUID;
import java.io.Serializable;

public class Book implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
private String bookID;
private String title;
private String author;
private boolean availability;
private String description;
static int currentID = 0;

public Book(String title, String author, String description) {
currentID ++;
this.bookID = String.valueOf(currentID);
this.title = title;
this.author = author;
this.description = description;
this.availability = true;
}

public String getBookID() {
return bookID;
}

public String getTitle() {
return title;
}

public void setTitle(String title) {
this.title = title;
}

public String getAuthor() {
return author;
}

public void setAuthor(String author) {
this.author = author;
}

public boolean isAvailability() {
return availability;
}

public void setAvailability(boolean availability) {
this.availability = availability;
}

public String getDescription() {
return description;
}

public void setDescription(String description) {
this.description = description;
}
@Override
public String toString() {
return "Book{" +
"bookID='" + getBookID() + '\'' +
", title='" + getTitle() + '\'' +
", author='" + getAuthor() + '\'' +
", availability=" + isAvailability() +
", description='" + getDescription() + '\'' +
'}';
}
}
Loading