Welcome to mirror list, hosted at ThFree Co, Russian Federation.

SectionItem.java « section « items « main « notes « owncloud « niedermann « it « java « main « src « app - github.com/stefan-niedermann/nextcloud-notes.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 38cdd237950edad94aad23d4b3aef49366dc52e0 (plain)
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
package it.niedermann.owncloud.notes.main.items.section;

import androidx.annotation.NonNull;

import java.util.Objects;

import it.niedermann.owncloud.notes.shared.model.Item;

public class SectionItem implements Item {

    private String title;

    public SectionItem(String title) {
        this.title = title;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    @Override
    public boolean isSection() {
        return true;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof SectionItem that)) return false;

        return Objects.equals(title, that.title);
    }

    @Override
    public int hashCode() {
        return title != null ? title.hashCode() : 0;
    }

    @NonNull
    @Override
    public String toString() {
        return "SectionItem{" +
                "title='" + title + '\'' +
                '}';
    }
}