01: /*
02: * Copyright 2000,2005 wingS development team.
03: *
04: * This file is part of wingS (http://wingsframework.org).
05: *
06: * wingS is free software; you can redistribute it and/or modify
07: * it under the terms of the GNU Lesser General Public License
08: * as published by the Free Software Foundation; either version 2.1
09: * of the License, or (at your option) any later version.
10: *
11: * Please see COPYING for the complete licence.
12: */
13: package org.wings.session;
14:
15: import java.io.Serializable;
16:
17: /**
18: * Typesafe enumeration class of operating systems on browsers client side.
19: */
20: public class OSType implements Serializable {
21: /**
22: * Operating system information could not be found.
23: */
24: public static final OSType UNKNOWN = new OSType(0, "Unknown OS");
25:
26: /**
27: * Browser os is of type Unix.
28: */
29: public static final OSType UNIX = new OSType(1, "Unix");
30:
31: /**
32: * Browser os is of type Windows.
33: */
34: public static final OSType WINDOWS = new OSType(2, "Windows");
35:
36: /**
37: * Browser os is of type MacOS
38: */
39: public static final OSType MACOS = new OSType(3, "Mac OS");
40:
41: /**
42: * Browser os is of type IBM-os. f.e. os/2
43: */
44: public static final OSType IBMOS = new OSType(4, "IBM OS/2");
45:
46: private int id;
47: private String name;
48:
49: /** Typesafe enum constructor. */
50: private OSType(int id, String name) {
51: this .id = id;
52: this .name = name;
53: }
54:
55: /**
56: * @return A unique id for this operating system.
57: */
58: public int getId() {
59: return id;
60: }
61:
62: /**
63: * @return Clear-Text browserName of this operating system
64: */
65: public String getName() {
66: return name;
67: }
68:
69: public String toString() {
70: return getName();
71: }
72: }
|