source: src/main/java/model/Subject.java@ 1eb7a55

Last change on this file since 1eb7a55 was 1eb7a55, checked in by Elena Markovska <elena.elenamarkovska@…>, 11 days ago

Initial commit - Scholaris project code

  • Property mode set to 100644
File size: 1.6 KB
Line 
1package model;
2
3import java.util.Objects;
4
5public class Subject {
6 private Long id;
7
8 private String name;
9
10 private int semester;
11
12 private int credits;
13
14 private Long facultyid;
15
16 public Subject(Long id, String name, int semester, int credits, Long facultyid) {
17 this.id = id;
18 this.name = name;
19 this.semester = semester;
20 this.credits = credits;
21 this.facultyid = facultyid;
22 }
23
24 public Long getId() {
25 return id;
26 }
27
28 public void setId(Long id) {
29 this.id = id;
30 }
31
32 public String getName() {
33 return name;
34 }
35
36 public void setName(String name) {
37 this.name = name;
38 }
39
40 public int getSemester() {
41 return semester;
42 }
43
44 public void setSemester(int semester) {
45 this.semester = semester;
46 }
47
48 public int getCredits() {
49 return credits;
50 }
51
52 public void setCredits(int credits) {
53 this.credits = credits;
54 }
55
56 public Long getFacultyid() {
57 return facultyid;
58 }
59
60 public void setFacultyid(Long facultyid) {
61 this.facultyid = facultyid;
62 }
63
64 @Override
65 public boolean equals(Object o) {
66 if (o == null || getClass() != o.getClass()) return false;
67 Subject subject = (Subject) o;
68 return credits == subject.credits && Objects.equals(id, subject.id) && Objects.equals(name, subject.name) && Objects.equals(semester, subject.semester) && Objects.equals(facultyid, subject.facultyid);
69 }
70
71 @Override
72 public int hashCode() {
73 return Objects.hash(id, name, semester, credits, facultyid);
74 }
75}
Note: See TracBrowser for help on using the repository browser.