OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Rev

Rev 74 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 74 Rev 181
Line 21... Line 21...
21
        this.id = id;
21
        this.id = id;
22
        this.group = new Group(id);
22
        this.group = new Group(id);
23
    }
23
    }
24
 
24
 
25
    public String getId() {
25
    public String getId() {
26
        return id;
26
        return this.id;
27
    }
27
    }
28
 
28
 
29
    public void setId(String id) {
29
    public void setId(String id) {
30
        this.id = id;
30
        this.id = id;
31
    }
31
    }
32
 
32
 
33
    public Group getGroup() {
33
    public Group getGroup() {
34
        return group;
34
        return this.group;
35
    }
35
    }
36
 
36
 
37
    @Override
37
    @Override
38
    public String toString() {
38
    public String toString() {
39
        return this.getId();
39
        return this.getId();
40
    }
40
    }
41
 
41
 
42
    public boolean containsGroupId(String gId) {
42
    public boolean containsGroupId(String gId) {
43
        return containsGroup(group, gId);
43
        return containsGroup(this.group, gId);
44
    }
44
    }
45
 
45
 
46
    private boolean containsGroup(Item item, String gId) {
46
    private boolean containsGroup(Item item, String gId) {
47
        if (item.getId().equals(gId)) {
47
        if (item.getId().equals(gId)) {
48
            return true;
48
            return true;
Line 59... Line 59...
59
        }
59
        }
60
        return false;
60
        return false;
61
    }
61
    }
62
 
62
 
63
    public Item getItemFromId(String id) {
63
    public Item getItemFromId(String id) {
64
        return getItemFromId(group, id);
64
        return getItemFromId(this.group, id);
65
    }
65
    }
66
 
66
 
67
    private Item getItemFromId(Item item, String gId) {
67
    private Item getItemFromId(Item item, String gId) {
68
        if (item.getId().equals(gId)) {
68
        if (item.getId().equals(gId)) {
69
            return item;
69
            return item;