1 17 package org.apache.ws.jaxme.xs.xml; 18 19 20 37 public class XsFormChoice { 38 public static final XsFormChoice QUALIFIED = new XsFormChoice("qualified"); 39 public static final XsFormChoice UNQUALIFIED = new XsFormChoice("unqualified"); 40 private final String value; 41 private XsFormChoice(String pValue) { 42 value = pValue; 43 } 44 public String toString() { return value; } 45 public String getValue() { return value; } 46 public int hashCode() { 47 return value.hashCode(); 48 } 49 public boolean equals(Object o) { 50 return o != null && XsFormChoice.class.equals(o.getClass()) && 51 value.equals(((XsFormChoice) o).value); 52 } 53 public static XsFormChoice valueOf(String pValue) { 54 if ("qualified".equals(pValue)) { 55 return QUALIFIED; 56 } else if ("unqualified".equals(pValue)) { 57 return UNQUALIFIED; 58 } else { 59 throw new IllegalArgumentException ("Invalid form value: " + pValue + ", expected either of 'qualified' or 'unqualified'" ); 60 } 61 } 62 } 63 | Popular Tags |