Top Description Fields Constructors Methods
org.h2.value

public final Class ValueUuid

extends Value
Class Inheritance
Static Imports
org.h2.util.Bits.LONG_VH_BE

Implementation of the UUID data type.

Field Summary

Modifier and TypeField and Description
pack-priv static final int
DISPLAY_SIZE

The display size of the textual representation of a UUID.

private final long
private final long
pack-priv static final int
PRECISION

The precision of this value in number of bytes.

Inherited from org.h2.value.Value:
ARRAYASSIGN_TOBIGINTBINARYBLOBBOOLEANCAST_TOCHARCLOBCONVERT_TODATEDECFLOATDOUBLEEMPTY_VALUESENUMGEOMETRYGROUP_BINARY_STRINGGROUP_BOOLEANGROUP_CHARACTER_STRINGGROUP_COLLECTIONGROUP_DATETIMEGROUP_INTERVAL_DTGROUP_INTERVAL_YMGROUP_NULLGROUP_NUMERICGROUP_OTHERGROUPSINTEGERINTERVAL_DAYINTERVAL_DAY_TO_HOURINTERVAL_DAY_TO_MINUTEINTERVAL_DAY_TO_SECONDINTERVAL_HOURINTERVAL_HOUR_TO_MINUTEINTERVAL_HOUR_TO_SECONDINTERVAL_MINUTEINTERVAL_MINUTE_TO_SECONDINTERVAL_MONTHINTERVAL_SECONDINTERVAL_YEARINTERVAL_YEAR_TO_MONTHJAVA_OBJECTJSONMAX_LONG_DECIMALMIN_LONG_DECIMALNULLNUMERICREALROWSMALLINTTIMETIME_TZTIMESTAMPTIMESTAMP_TZTINYINTTYPE_COUNTUNKNOWNUUIDVARBINARYVARCHARVARCHAR_IGNORECASE

Constructor Summary

AccessConstructor and Description
private
ValueUuid(long high, long low)

Method Summary

Modifier and TypeMethod and Description
private StringBuilder
public long
charLength()

Overrides org.h2.value.Value.charLength.

Returns length of this value in characters.

public int
compareTypeSafe(Value
the other value
o
,
CompareMode
the compare mode
mode
,
CastDataProvider
the cast information provider
provider
)

Implements abstract org.h2.value.Value.compareTypeSafe.

Compare this value against another value given that the values are of the same data type.

public boolean
equals(Object
the other value
other
)

Implements abstract org.h2.value.Value.equals.

Check if the two values have the same hash code.

public static ValueUuid

Returns:

the UUID
get
(byte[]
the byte array
binary
)

Get or create a UUID for the given 16 bytes.

public static ValueUuid

Returns:

the UUID
get
(long
the most significant bits
high
,
long
the least significant bits
low
)

Get or create a UUID for the given high and low order values.

public static ValueUuid

Returns:

the UUID
get
(UUID
Java UUID
uuid
)

Get or create a UUID for the given Java UUID.

public static ValueUuid

Returns:

the UUID
get
(String
the text representation of the UUID
s
)

Get or create a UUID for the given text representation.

public byte[]
public long

Returns:

the high order bits
getHigh
()

Get the most significant 64 bits of this UUID.

public long

Returns:

the low order bits
getLow
()

Get the least significant 64 bits of this UUID.

public int
getMemory()

Overrides org.h2.value.Value.getMemory.

Get the memory used by this object.

public static ValueUuid

Returns:

the new UUID
getNewRandom
(int
a version to use
version
)

Create a new UUID using the pseudo random number generator.

public StringBuilder
getSQL(StringBuilder
string builder
builder
,
int
formatting flags
sqlFlags
)

Implements org.h2.util.HasSQL.getSQL.

Appends the SQL statement of this object to the specified builder.

public String
getString()

Implements abstract org.h2.value.Value.getString.

Get the value as a string.

public TypeInfo
getType()

Implements abstract org.h2.value.Value.getType.

Implements org.h2.value.Typed.getType.

Returns the data type.

public UUID

Returns:

the UUID
getUuid
()

Returns the UUID.

public int
getValueType()

Implements abstract org.h2.value.Value.getValueType.

Get the value type.

public int
hashCode()

Implements abstract org.h2.value.Value.hashCode.

Returns a hash code value for this object.

public long
octetLength()

Overrides org.h2.value.Value.octetLength.

Returns length of this value in bytes.

Inherited from org.h2.value.Value:
addcachecastToclearCachecompareTocompareWithNullcontainsNullconvertForAssignToconvertToconvertToconvertToconvertToconvertToconvertToAnyArrayconvertToAnyJsonconvertToAnyRowconvertToBigintconvertToBooleanconvertToCharconvertToDateconvertToDoubleconvertToEnumconvertToGeometryconvertToIntconvertToIntconvertToJavaObjectconvertToJsonconvertToLongconvertToRealconvertToSmallintconvertToTinyintconvertToUuiddividegetBigDecimalgetBooleangetBytegetBytesNoCopygetDataConversionErrorgetDataConversionErrorgetDoublegetFloatgetHigherOrdergetHigherOrderKnowngetInputStreamgetInputStreamgetIntgetLonggetReadergetReadergetShortgetSignumgetTypeNamegetUnsupportedExceptionForOperationgetValueTooLongExceptiongetValueWithFirstNullgetValueWithFirstNullImplisFalseisTruemodulusmultiplynegaterangeChecksubtracttoString

Field Detail

DISPLAY_SIZEback to summary
pack-priv static final int DISPLAY_SIZE

The display size of the textual representation of a UUID. Example: cd38d882-7ada-4589-b5fb-7da0ca559d9a

highback to summary
private final long high
lowback to summary
private final long low
PRECISIONback to summary
pack-priv static final int PRECISION

The precision of this value in number of bytes.

Constructor Detail

ValueUuidback to summary
private ValueUuid(long high, long low)

Method Detail

addStringback to summary
private StringBuilder addString(StringBuilder builder)
charLengthback to summary
public long charLength()

Overrides org.h2.value.Value.charLength.

Doc from org.h2.value.Value.charLength.

Returns length of this value in characters.

Returns:long

length of this value in characters

Annotations
@Override
compareTypeSafeback to summary
public int compareTypeSafe(Value o, CompareMode mode, CastDataProvider provider)

Implements abstract org.h2.value.Value.compareTypeSafe.

Doc from org.h2.value.Value.compareTypeSafe.

Compare this value against another value given that the values are of the same data type.

Parameters
o:Value

the other value

mode:CompareMode

the compare mode

provider:CastDataProvider

the cast information provider

Returns:int

0 if both values are equal, -1 if the other value is smaller, and 1 otherwise

Annotations
@Override
equalsback to summary
public boolean equals(Object other)

Implements abstract org.h2.value.Value.equals.

Doc from org.h2.value.Value.equals.

Check if the two values have the same hash code. No data conversion is made; this method returns false if the other object is not of the same class. For some values, compareTo may return 0 even if equals return false. Example: ValueDecimal 0.0 and 0.00.

Parameters
other:Object

the other value

Returns:boolean

true if they are equal

Annotations
@Override
getback to summary
public static ValueUuid get(byte[] binary)

Get or create a UUID for the given 16 bytes.

Parameters
binary:byte[]

the byte array

Returns:ValueUuid

the UUID

getback to summary
public static ValueUuid get(long high, long low)

Get or create a UUID for the given high and low order values.

Parameters
high:long

the most significant bits

low:long

the least significant bits

Returns:ValueUuid

the UUID

getback to summary
public static ValueUuid get(UUID uuid)

Get or create a UUID for the given Java UUID.

Parameters
uuid:UUID

Java UUID

Returns:ValueUuid

the UUID

getback to summary
public static ValueUuid get(String s)

Get or create a UUID for the given text representation.

Parameters
s:String

the text representation of the UUID

Returns:ValueUuid

the UUID

getBytesback to summary
public byte[] getBytes()

Overrides org.h2.value.Value.getBytes.

Annotations
@Override
getHighback to summary
public long getHigh()

Get the most significant 64 bits of this UUID.

Returns:long

the high order bits

getLowback to summary
public long getLow()

Get the least significant 64 bits of this UUID.

Returns:long

the low order bits

getMemoryback to summary
public int getMemory()

Overrides org.h2.value.Value.getMemory.

Doc from org.h2.value.Value.getMemory.

Get the memory used by this object.

Returns:int

the memory used in bytes

Annotations
@Override
getNewRandomback to summary
public static ValueUuid getNewRandom(int version)

Create a new UUID using the pseudo random number generator.

Parameters
version:int

a version to use

Returns:ValueUuid

the new UUID

getSQLback to summary
public StringBuilder getSQL(StringBuilder builder, int sqlFlags)

Implements org.h2.util.HasSQL.getSQL.

Doc from org.h2.util.HasSQL.getSQL.

Appends the SQL statement of this object to the specified builder.

Parameters
builder:StringBuilder

string builder

sqlFlags:int

formatting flags

Returns:StringBuilder

the specified string builder

Annotations
@Override
getStringback to summary
public String getString()

Implements abstract org.h2.value.Value.getString.

Doc from org.h2.value.Value.getString.

Get the value as a string.

Returns:String

the string

Annotations
@Override
getTypeback to summary
public TypeInfo getType()

Implements abstract org.h2.value.Value.getType.

Implements org.h2.value.Typed.getType.

Doc from org.h2.value.Typed.getType.

Returns the data type.

Returns:TypeInfo

the data type

Annotations
@Override
getUuidback to summary
public UUID getUuid()

Returns the UUID.

Returns:UUID

the UUID

getValueTypeback to summary
public int getValueType()

Implements abstract org.h2.value.Value.getValueType.

Doc from org.h2.value.Value.getValueType.

Get the value type.

Returns:int

the value type

Annotations
@Override
hashCodeback to summary
public int hashCode()

Implements abstract org.h2.value.Value.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object

Annotations
@Override
octetLengthback to summary
public long octetLength()

Overrides org.h2.value.Value.octetLength.

Doc from org.h2.value.Value.octetLength.

Returns length of this value in bytes.

Returns:long

length of this value in bytes

Annotations
@Override