01: /*
02:
03: Derby - Class org.apache.derby.catalog.UUID
04:
05: Licensed to the Apache Software Foundation (ASF) under one or more
06: contributor license agreements. See the NOTICE file distributed with
07: this work for additional information regarding copyright ownership.
08: The ASF licenses this file to You under the Apache License, Version 2.0
09: (the "License"); you may not use this file except in compliance with
10: the License. You may obtain a copy of the License at
11:
12: http://www.apache.org/licenses/LICENSE-2.0
13:
14: Unless required by applicable law or agreed to in writing, software
15: distributed under the License is distributed on an "AS IS" BASIS,
16: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17: See the License for the specific language governing permissions and
18: limitations under the License.
19:
20: */
21:
22: package org.apache.derby.catalog;
23:
24: /**
25:
26: An interface for accessing Cloudscape UUIDs, unique identifiers.
27:
28: <p>The values in the
29: system catalog held in ID columns with a type of CHAR(36) are the
30: string representations of these UUIDs.
31:
32: <p>A UUID implements equals() and hashCode based on value equality.
33:
34: */
35:
36: public interface UUID extends java.io.Externalizable {
37: /**
38: UUID_BYTE_LENGTH
39:
40: The number of bytes in the array toByteArray returns.
41: */
42: static int UUID_BYTE_LENGTH = 16;
43:
44: /**
45: Produce a string representation of this UUID which
46: is suitable for use as a unique ANSI identifier.
47: */
48: String toANSIidentifier();
49:
50: /**
51: Produce a byte array representation of this UUID
52: which can be passed to UUIDFactory.recreateUUID later
53: on to reconstruct it.
54: */
55: byte[] toByteArray();
56:
57: /**
58: Clone this UUID.
59:
60: @return a copy of this UUID
61: */
62: UUID cloneMe();
63:
64: /**
65: Create a hex string representation of this UUID.
66: */
67: String toHexString();
68: }
|