1
2
3
4 package fr.paris.lutece.plugins.dila.business.enums;
5
6
7
8
9
10 public enum AudienceCategoryEnum
11 {INDIVIDUALS( 1L, "Particuliers" ),
12 ASSOCIATIONS( 2L, "Associations" ),
13 PROFESSIONNALS( 3L, "Professionnels" );
14
15 private Long _lId;
16 private String _strLabel;
17
18
19
20
21
22
23 private AudienceCategoryEnum( Long lId, String strLabel )
24 {
25 this._lId = lId;
26 this._strLabel = strLabel;
27 }
28
29
30
31
32
33
34 public static AudienceCategoryEnum fromId( Long lId )
35 {
36 for ( AudienceCategoryEnum e : AudienceCategoryEnum.values( ) )
37 {
38 if ( e.getId( ).equals( lId ) )
39 {
40 return e;
41 }
42 }
43
44 return null;
45 }
46
47
48
49
50 public Long getId( )
51 {
52 return _lId;
53 }
54
55
56
57
58 public String getLabel( )
59 {
60 return _strLabel;
61 }
62
63
64
65
66
67
68 public static AudienceCategoryEnum fromLabel( String strLabel )
69 {
70 for ( AudienceCategoryEnum e : AudienceCategoryEnum.values( ) )
71 {
72 if ( e.getLabel( ).equalsIgnoreCase( strLabel ) )
73 {
74 return e;
75 }
76 }
77
78 return null;
79 }
80 }