KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > portal > portlet > metadata > TransportGuarantee


1 /*****************************************
2  * *
3  * JBoss Portal: The OpenSource Portal *
4  * *
5  * Distributable under LGPL license. *
6  * See terms of license at gnu.org. *
7  * *
8  *****************************************/

9
10 package org.jboss.portal.portlet.metadata;
11
12 public class TransportGuarantee
13 {
14
15    public static final TransportGuarantee NONE = new TransportGuarantee("NONE");
16    public static final TransportGuarantee INTEGRAL = new TransportGuarantee("INTEGRAL");
17    public static final TransportGuarantee CONFIDENTIAL = new TransportGuarantee("CONFIDENTIAL");
18
19    public static TransportGuarantee decode(String JavaDoc name)
20    {
21       if (NONE.getName().equals(name))
22       {
23          return NONE;
24       }
25       else if (INTEGRAL.getName().equals(name))
26       {
27          return INTEGRAL;
28       }
29       else if (CONFIDENTIAL.getName().equals(name))
30       {
31          return CONFIDENTIAL;
32       }
33       else
34       {
35          throw new IllegalArgumentException JavaDoc();
36       }
37    }
38
39    private String JavaDoc name;
40
41    public TransportGuarantee(String JavaDoc name)
42    {
43       this.name = name;
44    }
45
46    public String JavaDoc getName()
47    {
48       return name;
49    }
50 }
51
Popular Tags