1 23 24 package com.sun.enterprise.admin.common.domains.registry; 25 import java.io.Serializable ; 26 import java.lang.CloneNotSupportedException ; 27 28 36 37 38 public class ContactData implements Cloneable , Serializable 39 { 40 41 51 public ContactData(String host, 52 String port, 53 boolean useSSL) throws NullPointerException { 54 55 checkNull(host); 56 this.host = host; 57 checkNull(port); 58 this.port = port; 59 this.useSSL = useSSL; 60 } 61 62 66 public String getHost(){ 67 return this.host; 68 } 69 70 74 public String getPort(){ 75 return this.port; 76 } 77 82 public boolean useSSL(){ 83 return this.useSSL; 84 } 85 86 public Object clone(){ 87 try { 88 return super.clone(); 89 } 90 catch (CloneNotSupportedException e){ return null;} 91 92 } 93 94 public int hashcode(){ 95 final String s = host+port+(useSSL ? "t" : "f"); 96 return s.hashCode(); 97 } 98 99 private void checkNull(String s) throws NullPointerException { 100 if (s == null) { 101 throw new NullPointerException (); 102 } 103 } 104 105 private String host; 106 private String port; 107 private boolean useSSL; 108 } 109 | Popular Tags |