1 7 8 9 package javax.print.attribute; 10 11 import java.io.Serializable ; 12 import java.net.URI ; 13 import java.net.URISyntaxException ; 14 15 23 public abstract class URISyntax implements Serializable , Cloneable { 24 25 private static final long serialVersionUID = -7842661210486401678L; 26 27 31 private URI uri; 32 33 41 protected URISyntax(URI uri) { 42 this.uri = verify (uri); 43 } 44 45 private static URI verify(URI uri) { 46 if (uri == null) { 47 throw new NullPointerException (" uri is null"); 48 } 49 return uri; 50 } 51 52 56 public URI getURI() { 57 return uri; 58 } 59 60 65 public int hashCode() { 66 return uri.hashCode(); 67 } 68 69 88 public boolean equals(Object object) { 89 return(object != null && 90 object instanceof URISyntax && 91 this.uri.equals (((URISyntax ) object).uri)); 92 } 93 94 100 public String toString() { 101 return uri.toString(); 102 } 103 104 } 105 | Popular Tags |