01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: package javax.print.attribute;
19:
20: import java.io.Serializable;
21: import java.net.URI;
22:
23: public abstract class URISyntax implements Cloneable, Serializable {
24: private static final long serialVersionUID = -7842661210486401678L;
25:
26: private final URI uri;
27:
28: protected URISyntax(URI uriValue) {
29: super ();
30: if (uriValue == null) {
31: throw new NullPointerException();
32: }
33: uri = uriValue;
34: }
35:
36: @Override
37: public boolean equals(Object object) {
38: if ((object instanceof URISyntax)
39: && uri.equals(((URISyntax) object).uri)) {
40: return true;
41: }
42: return false;
43: }
44:
45: public URI getURI() {
46: return uri;
47: }
48:
49: @Override
50: public int hashCode() {
51: return uri.hashCode();
52: }
53:
54: @Override
55: public String toString() {
56: return uri.toString();
57: }
58: }
|