1 18 package org.apache.beehive.netui.pageflow; 19 20 23 public class SecurityProtocol 24 { 25 protected static final int INT_SECURE = 0; 26 protected static final int INT_UNSECURE = 1; 27 protected static final int INT_UNSPECIFIED = 2; 28 29 public static final SecurityProtocol SECURE = new SecurityProtocol( INT_SECURE ); 30 public static final SecurityProtocol UNSECURE = new SecurityProtocol( INT_UNSECURE ); 31 public static final SecurityProtocol UNSPECIFIED = new SecurityProtocol( INT_UNSPECIFIED ); 32 33 private int _val; 34 35 private SecurityProtocol( int val ) 36 { 37 _val = val; 38 } 39 40 public String toString() 41 { 42 switch ( _val ) 43 { 44 case INT_SECURE : return "secure"; 45 case INT_UNSECURE: return "unsecure"; 46 case INT_UNSPECIFIED: return "unspecified"; 47 } 48 49 assert false : _val; 50 return "<unknown Modifier>"; 51 } 52 53 public boolean equals( Object o ) 54 { 55 if ( o == null ) return false; 56 if ( o == this ) return true; 57 if ( ! ( o instanceof SecurityProtocol ) ) return false; 58 return ( ( SecurityProtocol ) o )._val == _val; 59 } 60 61 public int hashCode() 62 { 63 return _val; 64 } 65 } 66 | Popular Tags |