1 23 24 package com.sun.enterprise.admin.common.domains.registry; 25 import java.io.File ; 26 import java.io.Serializable ; 27 import java.io.IOException ; 28 29 30 40 41 42 public class DomainEntry implements Cloneable , Serializable 43 { 44 45 52 public DomainEntry(String name, File root, ContactDataSet contactData) throws NullPointerException { 53 if (name == null || root == null || contactData == null) { 54 throw new NullPointerException (); 55 } 56 this.name = name; 57 this.root = root; 58 try 59 { 60 this.path = root.getCanonicalPath(); 61 } 62 catch(IOException ioe) 63 { 64 this.path = root.getAbsolutePath(); 65 } 66 this.contactData = contactData; 67 } 68 69 73 public String getName(){ 74 return this.name; 75 } 76 77 81 public File getRoot(){ 82 return this.root; 83 } 84 85 89 public String getPath(){ 90 return this.path; 91 } 92 93 97 public ContactDataSet getContactData(){ 98 return this.contactData; 99 } 100 101 public Object clone() { 102 try { 103 return super.clone(); 104 } 105 catch (CloneNotSupportedException c){ 106 return null; 107 } 108 } 109 110 public int hashcode(){ 111 final String s = this.name+this.root.toString(); 112 return s.hashCode(); 113 } 114 115 public boolean equals(Object rhs){ 116 return rhs != null && rhs instanceof DomainEntry && this.equals((DomainEntry) rhs); 117 } 118 119 private boolean equals(DomainEntry rhs){ 120 return rhs != null && this == rhs || 121 (this.name.equals(rhs.name) && this.root.equals(rhs.root)); 122 } 123 124 private String name; 125 private File root; 126 private String path; 127 private ContactDataSet contactData; 128 129 } 130 | Popular Tags |