-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStringSection.java
More file actions
40 lines (31 loc) · 963 Bytes
/
StringSection.java
File metadata and controls
40 lines (31 loc) · 963 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
package webapp.model;
import java.util.Objects;
public class StringSection extends Section {
private static final long serialVersionUID = 1L;
public static final StringSection EMPTY = new StringSection();
private String stringSection;
public String getStringSection() {
return stringSection;
}
public StringSection() {
this.stringSection = EMPTY_STRING;
}
public StringSection(String stringSection) {
this.stringSection = stringSection;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof StringSection)) return false;
StringSection that = (StringSection) o;
return Objects.equals(getStringSection(), that.getStringSection());
}
@Override
public int hashCode() {
return Objects.hash(getStringSection());
}
@Override
public String toString() {
return stringSection;
}
}