-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOriginator.java
More file actions
61 lines (51 loc) · 1.74 KB
/
Originator.java
File metadata and controls
61 lines (51 loc) · 1.74 KB
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
package designpatterns.behavioral.memento;
public class Originator {
private Juego estado;
public Memento guardar() {
return new Memento(estado);
}
public void restaurar(Memento m) {
this.estado = m.getEstado();
}
@java.lang.SuppressWarnings("all")
public Originator() {
}
@java.lang.SuppressWarnings("all")
public Juego getEstado() {
return this.estado;
}
@java.lang.SuppressWarnings("all")
public void setEstado(final Juego estado) {
this.estado = estado;
}
@java.lang.Override
@java.lang.SuppressWarnings("all")
public boolean equals(final java.lang.Object o) {
if (o == this) return true;
if (!(o instanceof Originator)) return false;
final Originator other = (Originator) o;
if (!other.canEqual((java.lang.Object) this)) return false;
final java.lang.Object this$estado = this.getEstado();
final java.lang.Object other$estado = other.getEstado();
if (this$estado == null ? other$estado != null : !this$estado.equals(other$estado)) return false;
return true;
}
@java.lang.SuppressWarnings("all")
protected boolean canEqual(final java.lang.Object other) {
return other instanceof Originator;
}
@java.lang.Override
@java.lang.SuppressWarnings("all")
public int hashCode() {
final int PRIME = 59;
int result = 1;
final java.lang.Object $estado = this.getEstado();
result = result * PRIME + ($estado == null ? 43 : $estado.hashCode());
return result;
}
@java.lang.Override
@java.lang.SuppressWarnings("all")
public java.lang.String toString() {
return "Originator(estado=" + this.getEstado() + ")";
}
}