forked from JavaOPs/basejava
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOrganizationSection.java
More file actions
37 lines (28 loc) · 944 Bytes
/
OrganizationSection.java
File metadata and controls
37 lines (28 loc) · 944 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
package com.urise.webapp.model;
import java.util.List;
import java.util.Objects;
public class OrganizationSection extends AbstractSection {
private final List<Organization> organizations;
public OrganizationSection(List<Organization> organizations) {
Objects.requireNonNull(organizations, "organizations must not null");
this.organizations = organizations;
}
public List<Organization> getOrganizations() {
return organizations;
}
@Override
public String toString() {
return organizations.toString();
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
OrganizationSection that = (OrganizationSection) o;
return organizations.equals(that.organizations);
}
@Override
public int hashCode() {
return organizations.hashCode();
}
}