1 6 7 package javax.portlet; 8 9 10 29 public class PortletMode 30 { 31 32 44 public final static PortletMode VIEW = new PortletMode ("view"); 45 46 59 public final static PortletMode EDIT = new PortletMode ("edit"); 60 61 71 public final static PortletMode HELP = new PortletMode ("help"); 72 73 74 75 76 private String _name; 77 78 79 87 public PortletMode(String name) { 88 if (name==null) { 89 throw new IllegalArgumentException ("PortletMode name can not be NULL"); 90 } 91 _name = name.toLowerCase(); 92 } 93 94 95 101 102 public String toString() { 103 return _name; 104 } 105 106 113 114 public int hashCode() { 115 return _name.hashCode(); 116 } 117 118 128 129 public boolean equals(Object object) { 130 if ( object instanceof PortletMode ) 131 return _name.equals(((PortletMode) object)._name); 132 else 133 return false; 134 } 135 } 136 137 | Popular Tags |