Kenmegne
7 days ago 23a46b4be35277e06ec89f48730eeb694e686be8
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
package com.megatim.fdxconsultation.model.administration.security;
 
import com.megatim.fdxcommons.model.enumeration.TypeOperation;
import com.megatim.fdxconsultation.model.administration.Action;
import com.mgt.rs.security.core.ifaces.ActionRsSecurity;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
 
/**
 *
 * @author DYNABOOK
 */
public class ActionSecurity implements Comparable<ActionSecurity>, Serializable, ActionRsSecurity {
 
    private Long id;
 
    private String path;
 
    private String module;
 
    private String name;
 
    private String categorie;
 
    private String description;
 
    protected String idGenerer;
 
    private List<RoleSecurity> roles = new ArrayList<>();
 
    private TypeOperation typeOperation = TypeOperation.AJOUTER;
 
    public Long getId() {
        return id;
    }
 
    public void setId(Long id) {
        this.id = id;
    }
 
    public String getPath() {
        return path;
    }
 
    public void setPath(String path) {
        this.path = path;
    }
 
    public String getModule() {
        return module;
    }
 
    public void setModule(String module) {
        this.module = module;
    }
 
    public String getName() {
        return name;
    }
 
    public void setName(String name) {
        this.name = name;
    }
 
    public String getCategorie() {
        return categorie;
    }
 
    public void setCategorie(String categorie) {
        this.categorie = categorie;
    }
 
    public String getDescription() {
        return description;
    }
 
    public void setDescription(String description) {
        this.description = description;
    }
 
    public String getIdGenerer() {
        return idGenerer;
    }
 
    public void setIdGenerer(String idGenerer) {
        this.idGenerer = idGenerer;
    }
 
    public List<RoleSecurity> getRoles() {
        return roles;
    }
 
    public void setRoles(List<RoleSecurity> roles) {
        this.roles = roles;
    }
 
    public TypeOperation getTypeOperation() {
        return typeOperation;
    }
 
    public void setTypeOperation(TypeOperation typeOperation) {
        this.typeOperation = typeOperation;
    }
 
    public ActionSecurity() {
    }
 
    public ActionSecurity(Action action) {
        
        path = action.getPath();
        module = action.getModule();
        name = action.getName();
        categorie = action.getCategorie();
        description = action.getDescription();
        
    }
    
    @Override
    public int hashCode() {
        int hash = 7;
        hash = 79 * hash + Objects.hashCode(this.id);
        return hash;
    }
 
    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final ActionSecurity other = (ActionSecurity) obj;
        return Objects.equals(this.id, other.id);
    }
 
    /*
     * (non-Javadoc)
     * @see java.lang.Comparable#compareTo(java.lang.Object)
     */
    @Override
    public int compareTo(ActionSecurity parameter) {
 
        // Si le parametre est null
        if (parameter == null) {
            return -1;
        }
 
        // Si le code du parametre est vide
        if (parameter.id == null) {
            return -1;
        }
 
        // Si le code du parametre en cours est vide
        if (id == null) {
            return 1;
        }
 
        // On retourne la comparaison des codes
        return id.compareTo(parameter.id);
    }
}