001 //$HeadURL: svn+ssh://rbezema@svn.wald.intevation.org/deegree/base/branches/2.2_testing/src/org/deegree/framework/util/UUID.java $
002 /*
003
004 This class orginaly has been part of the apache derby project. It has
005 slightly been changed to match the requirements of deegree.
006
007 Derby - Class org.apache.derby.catalog.UUID
008
009 Copyright 1997, 2004 The Apache Software Foundation or its licensors, as applicable.
010
011 Licensed under the Apache License, Version 2.0 (the "License");
012 you may not use this file except in compliance with the License.
013 You may obtain a copy of the License at
014
015 http://www.apache.org/licenses/LICENSE-2.0
016
017 Unless required by applicable law or agreed to in writing, software
018 distributed under the License is distributed on an "AS IS" BASIS,
019 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
020 See the License for the specific language governing permissions and
021 limitations under the License.
022
023 */
024 package org.deegree.framework.util;
025
026 /**
027 *
028 * An interface for accessing Cloudscape UUIDs, unique identifiers.
029 *
030 * <p>
031 * The values in the system catalog held in ID columns with a type of CHAR(36) are the string
032 * representations of these UUIDs.
033 *
034 * <p>
035 * A UUID implements equals() and hashCode based on value equality.
036 *
037 */
038
039 public interface UUID extends java.io.Externalizable {
040 /**
041 * UUID_BYTE_LENGTH
042 *
043 * The number of bytes in the array toByteArray returns.
044 */
045 static int UUID_BYTE_LENGTH = 16;
046
047 /**
048 * Produce a string representation of this UUID which is suitable for use as a unique ANSI
049 * identifier.
050 */
051 String toANSIidentifier();
052
053 /**
054 * Produce a byte array representation of this UUID which can be passed to
055 * UUIDFactory.recreateUUID later on to reconstruct it.
056 */
057 byte[] toByteArray();
058
059 /**
060 * Clone this UUID.
061 *
062 * @return a copy of this UUID
063 */
064 UUID cloneMe();
065
066 /**
067 * Create a hex string representation of this UUID.
068 */
069 String toHexString();
070 }