public class ValueBytes extends Value
| Modifier and Type | Field and Description |
|---|---|
static ValueBytes |
EMPTY
Empty value.
|
protected int |
hash
The hash code.
|
protected TypeInfo |
type
Associated TypeInfo.
|
protected byte[] |
value
The value.
|
ARRAY, BLOB, BOOLEAN, BYTE, BYTES, CLOB, DATE, DECIMAL, DOUBLE, ENUM, FLOAT, GEOMETRY, INT, INTERVAL_DAY, INTERVAL_DAY_TO_HOUR, INTERVAL_DAY_TO_MINUTE, INTERVAL_DAY_TO_SECOND, INTERVAL_HOUR, INTERVAL_HOUR_TO_MINUTE, INTERVAL_HOUR_TO_SECOND, INTERVAL_MINUTE, INTERVAL_MINUTE_TO_SECOND, INTERVAL_MONTH, INTERVAL_SECOND, INTERVAL_YEAR, INTERVAL_YEAR_TO_MONTH, JAVA_OBJECT, JSON, LONG, MIN_LONG_DECIMAL, NULL, RESULT_SET, ROW, SHORT, STRING, STRING_FIXED, STRING_IGNORECASE, TIME, TIME_TZ, TIMESTAMP, TIMESTAMP_TZ, TYPE_COUNT, UNKNOWN, UUIDDUMMY| Modifier | Constructor and Description |
|---|---|
protected |
ValueBytes(byte[] v) |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTypeSafe(Value v,
CompareMode mode,
CastDataProvider provider)
Compare this value against another value given that the values are of the
same data type.
|
Value |
convertPrecision(long precision)
Convert the precision to the requested value.
|
boolean |
equals(java.lang.Object other)
Check if the two values have the same hash code.
|
static ValueBytes |
get(byte[] b)
Get or create a bytes value for the given byte array.
|
byte[] |
getBytes() |
byte[] |
getBytesNoCopy() |
int |
getMemory()
Get the memory used by this object.
|
static ValueBytes |
getNoCopy(byte[] b)
Get or create a bytes value for the given byte array.
|
java.lang.Object |
getObject()
Get the value as an object.
|
java.lang.StringBuilder |
getSQL(java.lang.StringBuilder builder)
Appends the SQL expression for this value to the specified builder.
|
java.lang.String |
getString()
Get the value as a string.
|
TypeInfo |
getType()
Returns the data type.
|
int |
getValueType()
Get the value type.
|
int |
hashCode() |
void |
set(java.sql.PreparedStatement prep,
int parameterIndex)
Set the value as a parameter in a prepared statement.
|
add, checkPrecision, clearCache, compareTo, compareWithNull, containsNull, convertScale, convertTo, convertTo, convertTo, convertTo, convertToInt, copy, copyToResult, copyToTemp, divide, getBigDecimal, getBoolean, getByte, getDataHandler, getDate, getDouble, getFloat, getHigherOrder, getHigherType, getInputStream, getInputStream, getInt, getLong, getReader, getReader, getResult, getShort, getSignum, getSmall, getSQL, getTableId, getTime, getTimestamp, getTraceSQL, getUnsupportedExceptionForOperation, isLinkedToTable, modulus, multiply, negate, remove, subtract, toStringgetCommittedValue, getCurrentValue, getOperationId, isCommittedpublic static final ValueBytes EMPTY
protected byte[] value
protected TypeInfo type
protected int hash
public static ValueBytes get(byte[] b)
b - the byte arraypublic static ValueBytes getNoCopy(byte[] b)
b - the byte arraypublic int getValueType()
ValuegetValueType in class Valuepublic java.lang.StringBuilder getSQL(java.lang.StringBuilder builder)
Valuepublic byte[] getBytesNoCopy()
getBytesNoCopy in class Valuepublic int compareTypeSafe(Value v, CompareMode mode, CastDataProvider provider)
ValuecompareTypeSafe in class Valuev - the other valuemode - the compare modeprovider - the cast information providerpublic java.lang.String getString()
Valuepublic java.lang.Object getObject()
Valuepublic void set(java.sql.PreparedStatement prep,
int parameterIndex)
throws java.sql.SQLException
Valuepublic int getMemory()
Valuepublic boolean equals(java.lang.Object other)
Valuepublic Value convertPrecision(long precision)
ValueconvertPrecision in class Valueprecision - the new precision