Source code: org/apache/derby/catalog/UUID.java
1 /*
2
3 Derby - Class org.apache.derby.catalog.UUID
4
5 Copyright 1997, 2004 The Apache Software Foundation or its licensors, as applicable.
6
7 Licensed under the Apache License, Version 2.0 (the "License");
8 you may not use this file except in compliance with the License.
9 You may obtain a copy of the License at
10
11 http://www.apache.org/licenses/LICENSE-2.0
12
13 Unless required by applicable law or agreed to in writing, software
14 distributed under the License is distributed on an "AS IS" BASIS,
15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 See the License for the specific language governing permissions and
17 limitations under the License.
18
19 */
20
21 package org.apache.derby.catalog;
22
23 /**
24
25 An interface for accessing Cloudscape UUIDs, unique identifiers.
26
27 <p>The values in the
28 system catalog held in ID columns with a type of CHAR(36) are the
29 string representations of these UUIDs.
30
31 <p>A UUID implements equals() and hashCode based on value equality.
32
33 */
34
35 public interface UUID extends java.io.Externalizable
36 {
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 }
69