View Javadoc

1   /*
2    * jGuild Project: jRPM
3    * Released under the Apache License ( http://www.apache.org/LICENSE )
4    */
5   package com.jguild.jrpm.io.constant;
6   
7   
8   /***
9    * Constants for OS type.
10   */
11  public final class LeadOS implements EnumIf {
12      public static final LeadOS UNKNOWN = new LeadOS(_UNKNOWN, "UNKNOWN");
13      public static final int _LINUX = 1;
14      public static final LeadOS LINUX = new LeadOS(_LINUX, "Linux");
15      public static final int _IRIX = 2;
16      public static final LeadOS IRIX = new LeadOS(_IRIX, "IRIX");
17      public static final int _SUNOS5 = 3;
18      public static final LeadOS SUNOS5 = new LeadOS(_SUNOS5, "SunOS 5");
19      public static final int _SUNOS4 = 4;
20      public static final LeadOS SUNOS4 = new LeadOS(_SUNOS4, "SunOS 4");
21      public static final int _AIX = 5;
22      public static final LeadOS AIX = new LeadOS(_AIX, "AIX");
23      public static final int _HPUX = 6;
24      public static final LeadOS HPUX = new LeadOS(_HPUX, "HP-UX");
25      public static final int _OSF = 7;
26      public static final LeadOS OSF = new LeadOS(_OSF, "OSF");
27      public static final int _FREEBSD = 8;
28      public static final LeadOS FREEBSD = new LeadOS(_FREEBSD, "FreeBSD");
29      public static final int _SCO_SV = 9;
30      public static final LeadOS SCO_SV = new LeadOS(_SCO_SV, "SVO SV");
31      public static final int _IRIX64 = 10;
32      public static final LeadOS IRIX64 = new LeadOS(_IRIX64, "IRIX 64");
33      public static final int _NEXTSTEP = 11;
34      public static final LeadOS NEXTSTEP = new LeadOS(_NEXTSTEP, "NextStep");
35      public static final int _BSD_OS = 12;
36      public static final LeadOS BSD_OS = new LeadOS(_BSD_OS, "BSD OS");
37      public static final int _MACHTEN = 13;
38      public static final LeadOS MACHTEN = new LeadOS(_MACHTEN, "machten");
39      public static final int _CYGWIN_NT = 14;
40      public static final LeadOS CYGWIN_NT = new LeadOS(_CYGWIN_NT, "Cygwin NT");
41      public static final int _CYGWIN_9X = 15;
42      public static final LeadOS CYGWIN_9X = new LeadOS(_CYGWIN_9X, "Cygwin 9x");
43      public static final int _UNIX_SV = 16;
44      public static final LeadOS UNIX_SV = new LeadOS(_UNIX_SV, "UNIX SV");
45      public static final int _MINT = 17;
46      public static final LeadOS MINT = new LeadOS(_MINT, "MiNT");
47      public static final int _OS_390 = 18;
48      public static final LeadOS OS_390 = new LeadOS(_OS_390, "OS/390");
49      public static final int _VM_ESA = 19;
50      public static final LeadOS VM_ESA = new LeadOS(_VM_ESA, "VM/ESA");
51      public static final int _LINUX_390 = 20;
52      public static final LeadOS LINUX_390 = new LeadOS(_LINUX_390, "Linux OS/390");
53      private EnumIf delegate;
54  
55      private LeadOS(int os, String name) {
56          delegate = new EnumDelegate(LeadOS.class, os, name, this);
57      }
58  
59      /***
60       * Get a enum by id
61       *
62       * @param id The id of the enum
63       * @return The enum object
64       */
65      public static EnumIf getEnumById(long id) {
66          return EnumDelegate.getEnumById(LeadOS.class, id);
67      }
68  
69      /***
70       * Get a enum by name
71       *
72       * @param name The name of the enum
73       * @return The enum object
74       */
75      public static EnumIf getEnumByName(String name) {
76          return EnumDelegate.getEnumByName(LeadOS.class, name);
77      }
78  
79      /***
80       * Get all defined enums of this class
81       *
82       * @return An array of all defined enum objects
83       */
84      public static String[] getEnumNames() {
85          return EnumDelegate.getEnumNames(LeadOS.class);
86      }
87  
88      /***
89       * Get a enum of this class by id
90       *
91       * @param os The id
92       * @return The enum object
93       */
94      public static LeadOS getLeadOS(int os) {
95          return (LeadOS) getEnumById(os);
96      }
97  
98      /***
99       * Check if this enum class contains a enum of a specified id
100      *
101      * @param id The id of the enum
102      * @return TRUE if the enum is defined in this class
103      */
104     public static boolean containsEnumId(Long id) {
105         return EnumDelegate.containsEnumId(LeadOS.class, id);
106     }
107 
108     /*
109      * @see com.jguild.jrpm.io.constant.EnumIf#getId()
110      */
111     public long getId() {
112         return delegate.getId();
113     }
114 
115     /*
116      * @see com.jguild.jrpm.io.constant.EnumIf#getName()
117      */
118     public String getName() {
119         return delegate.getName();
120     }
121 
122     /*
123      * @see java.lang.Object#toString()
124      */
125     public String toString() {
126         return delegate.toString();
127     }
128 }