1 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 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 (); 36 } 37 } 38 39 private String name; 40 41 public TransportGuarantee(String name) 42 { 43 this.name = name; 44 } 45 46 public String getName() 47 { 48 return name; 49 } 50 } 51 | Popular Tags |