View Javadoc
1   /**
2    *
3    */
4   package fr.paris.lutece.plugins.dila.business.enums;
5   
6   
7   /**
8    * Enum for all content type
9    *
10   */
11  public enum ContentTypeEnum
12  {CARD( 1L ),
13      NODE( 2L ),
14      RESOURCES( 3L ),
15      THEMES( 4L ),
16      PROFESSIONAL_THEMES( 5L ),
17      PIVOT( 6L ),
18      LOCAL( 7L );
19  
20      /**
21       * The content type id
22       */
23      private Long _lId;
24  
25      /**
26       * Constructor
27       * @param lId the id to set
28       */
29      private ContentTypeEnum( Long lId )
30      {
31          _lId = lId;
32      }
33  
34      /**
35       * @return the _lId
36       */
37      public Long getId(  )
38      {
39          return _lId;
40      }
41  
42      /**
43       * Get ContentTypeEnum from id
44       * @param id the id to get
45       * @return the corresponding enum, null if not found
46       */
47      public static ContentTypeEnum fromId( Long id )
48      {
49          for ( ContentTypeEnum e : ContentTypeEnum.values(  ) )
50          {
51              if ( e.getId(  ).equals( id ) )
52              {
53                  return e;
54              }
55          }
56  
57          return null;
58      }
59  }