-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStore.java
More file actions
43 lines (33 loc) · 723 Bytes
/
Store.java
File metadata and controls
43 lines (33 loc) · 723 Bytes
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
public class Store {
private String name, location;
public Store(String name, String location) {
this.name = name;
this.location = location;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getLocation() {
return location;
}
public void setLocation(String location) {
this.location = location;
}
@Override
public String toString() {
return name + " (" + location +")";
}
@Override
public boolean equals(Object obj) {
if(obj instanceof Store) {
Store other = (Store) obj;
return this.name.equalsIgnoreCase(other.name) &&
this.location.equalsIgnoreCase(other.location);
} else {
return false;
}
}
}