fr.arakne.swflangloader.lang.hints.HintCategory   A
last analyzed

Complexity

Total Complexity 10

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 24
c 1
b 0
f 0
dl 0
loc 47
ccs 11
cts 11
cp 1
rs 10
wmc 10

7 Methods

Rating   Name   Duplication   Size   Complexity  
A setId(int) 0 2 1
A color() 0 2 1
A id() 0 2 1
A name() 0 2 1
A hashCode() 0 3 1
A equals(Object) 0 6 4
A toString() 0 3 1
1
/*
2
 * This file is part of ArakneLangLoader.
3
 *
4
 * ArakneLangLoader is free software: you can redistribute it and/or modify
5
 * it under the terms of the GNU Lesser General Public License as published by
6
 * the Free Software Foundation, either version 3 of the License, or
7
 * (at your option) any later version.
8
 *
9
 * ArakneLangLoader is distributed in the hope that it will be useful,
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
 * GNU Lesser General Public License for more details.
13
 *
14
 * You should have received a copy of the GNU Lesser General Public License
15
 * along with ArakneLangLoader.  If not, see <https://www.gnu.org/licenses/>.
16
 *
17
 * Copyright (c) 2020 Vincent Quatrevieux
18
 */
19
20
package fr.arakne.swflangloader.lang.hints;
21
22
import java.util.Objects;
23
24
/**
25
 * Hint category
26
 */
27 1
final public class HintCategory {
28
    private int id;
29
30
    /* final */ private String n;
31
    /* final */ private String c;
32
33
    /**
34
     * @return The category name
35
     */
36
    public String name() {
37 1
        return n;
38
    }
39
40
    /**
41
     * @return The category color
42
     */
43
    public String color() {
44 1
        return c;
45
    }
46
47
    /**
48
     * @return The category id
49
     */
50
    public int id() {
51 1
        return id;
52
    }
53
54
    @Override
55
    public boolean equals(Object o) {
56 1
        if (this == o) return true;
57 1
        if (o == null || getClass() != o.getClass()) return false;
58 1
        HintCategory that = (HintCategory) o;
59 1
        return id == that.id;
60
    }
61
62
    @Override
63
    public int hashCode() {
64 1
        return Objects.hash(id);
65
    }
66
67
    @Override
68
    public String toString() {
69 1
        return "HintCategory{" + n + " (" + id + ")}";
70
    }
71
72
    void setId(int id) {
73 1
        this.id = id;
74 1
    }
75
}
76