1 6 package org.jfox.ejb.meta; 7 8 import java.io.Serializable ; 9 10 13 14 public class Protocol implements Serializable { 15 16 public static final Protocol JRMP = new Protocol("jrmp"); 17 public static final Protocol JRMP_SSL = new Protocol("jrmp_ssl"); 18 public static final Protocol SOAP = new Protocol("soap"); 19 public static final Protocol LOCAL = new Protocol("soap"); 20 21 private String protocol = "jrmp"; 22 23 private Protocol(String protocol) { 24 this.protocol = protocol; 25 } 26 27 public String getProtocol() { 28 return protocol.toLowerCase(); 29 } 30 31 public String toString() { 32 return protocol.toLowerCase(); 33 } 34 35 public boolean equals(Object o) { 36 if(this == o) return true; 37 if(!(o instanceof Protocol)) return false; 38 39 final Protocol prot = (Protocol) o; 40 41 if(!protocol.equals(prot.protocol)) return false; 42 43 return true; 44 } 45 46 public int hashCode() { 47 return protocol.hashCode(); 48 } 49 50 public static void main(String [] args) { 51 52 } 53 } 54 55 | Popular Tags |