-
Notifications
You must be signed in to change notification settings - Fork 1
/
Libro.java
115 lines (97 loc) · 2.25 KB
/
Libro.java
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
package biblioteca;
public class Libro {
private long isbn;
private String signatura;
private String titulo;
private String autor;
private String materia;
private String editorial;
public Libro(){
}
public Libro(long isbn, String signatura, String titulo, String autor, String materia, String editorial) {
this.isbn=isbn;
this.signatura=signatura;
this.titulo=titulo;
this.autor=autor;
this.materia=materia;
this.editorial=editorial;
}
public long getISBN() {
return isbn;
}
public void setISBN(long iSBN) {
isbn = iSBN;
}
public String getSignatura() {
return signatura;
}
public void setSignatura(String signatura) {
this.signatura = signatura;
}
public String getTitulo() {
return titulo;
}
public void setTitulo(String titulo) {
this.titulo = titulo;
}
public String getAutor() {
return autor;
}
public void setAutor(String autor) {
this.autor = autor;
}
public String getMateria() {
return materia;
}
public void setMateria(String materia) {
this.materia = materia;
}
public String getEditorial() {
return editorial;
}
public void setEditorial(String editorial) {
this.editorial = editorial;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Libro other = (Libro) obj;
if (isbn != other.isbn)
return false;
if (autor == null) {
if (other.autor != null)
return false;
} else if (!autor.equals(other.autor))
return false;
if (editorial == null) {
if (other.editorial != null)
return false;
} else if (!editorial.equals(other.editorial))
return false;
if (materia == null) {
if (other.materia != null)
return false;
} else if (!materia.equals(other.materia))
return false;
if (signatura == null) {
if (other.signatura != null)
return false;
} else if (!signatura.equals(other.signatura))
return false;
if (titulo == null) {
if (other.titulo != null)
return false;
} else if (!titulo.equals(other.titulo))
return false;
return true;
}
public String toString() {
return "ISBN: "+isbn+"\nSignatura: "+signatura+"\nTítulo: "+titulo+"\nAutor: "+autor
+"\nMateria: "+materia+"\nEditorial: "+editorial;
}
}