public final class ValueTimestampUtc extends Value
Value.ValueBlob, Value.ValueClob| Modifier and Type | Field and Description |
|---|---|
static int |
PRECISION
The precision in digits.
|
ARRAY, BLOB, BOOLEAN, BYTE, BYTES, CLOB, DATE, DECIMAL, DOUBLE, FLOAT, GEOMETRY, INT, JAVA_OBJECT, LONG, NULL, RESULT_SET, SHORT, STRING, STRING_FIXED, STRING_IGNORECASE, TIME, TIMESTAMP, TIMESTAMP_TZ, TIMESTAMP_UTC, TYPE_COUNT, UNKNOWN, UUID| Modifier and Type | Method and Description |
|---|---|
Value |
add(Value v)
Add a value and return the result.
|
protected int |
compareSecure(Value o,
CompareMode mode)
Compare the value with another value of the same type.
|
Value |
convertScale(boolean onlyToSmallerScale,
int targetScale)
Convert the scale.
|
boolean |
equals(java.lang.Object other)
Check if the two values have the same hash code.
|
static ValueTimestampUtc |
fromMillis(long ms)
Get or create a timestamp value for the given date/time in millis.
|
static ValueTimestampUtc |
fromMillisNanos(long utcDateTimeMillis,
int nanos)
Get or create a timestamp value for the given date/time in millis.
|
static ValueTimestampUtc |
fromNanos(long nanos)
Get or create a timestamp value for the given date/time in nanos.
|
int |
getDisplaySize()
Get the display size in characters.
|
long |
getLong() |
java.lang.Object |
getObject()
Get the value as an object.
|
long |
getPrecision()
Get the precision.
|
int |
getScale() |
java.lang.String |
getSQL()
Get the SQL expression for this value.
|
java.lang.String |
getString()
Get the value as a string.
|
java.sql.Timestamp |
getTimestamp() |
int |
getType()
Get the value type.
|
long |
getUtcDateTimeMillis()
Time in milliseconds since 1 Jan 1970 i.e.
|
long |
getUtcDateTimeNanos()
Time in nanoseconds since 1 Jan 1970 i.e.
|
int |
hashCode() |
static ValueTimestampUtc |
parse(java.lang.String s)
Parse a string to a ValueTimestamp.
|
void |
set(java.sql.PreparedStatement prep,
int parameterIndex)
Set the value as a parameter in a prepared statement.
|
Value |
subtract(Value v)
Subtract a value and return the result.
|
checkPrecision, clearCache, compareTo, compareTypeSafe, convertPrecision, convertTo, copy, copyToResult, copyToTemp, divide, getBigDecimal, getBoolean, getByte, getBytes, getBytesNoCopy, getDataHandler, getDate, getDouble, getFloat, getHigherOrder, getInputStream, getInt, getMemory, getReader, getResultSet, getShort, getSignum, getSmall, getTableId, getTime, getTraceSQL, isLinkedToTable, modulus, multiply, negate, remove, throwUnsupportedExceptionForType, toStringpublic static final int PRECISION
public static ValueTimestampUtc fromMillisNanos(long utcDateTimeMillis, int nanos)
utcDateTimeMillis - the date and time in UTC millisecondsnanos - the nanoseconds since the last millisecondpublic static ValueTimestampUtc fromMillis(long ms)
ms - the millisecondspublic static ValueTimestampUtc fromNanos(long nanos)
nanos - the nanospublic static ValueTimestampUtc parse(java.lang.String s)
s - the string to parsepublic long getUtcDateTimeNanos()
public long getUtcDateTimeMillis()
public java.sql.Timestamp getTimestamp()
getTimestamp in class Valuepublic int getType()
Valuepublic java.lang.String getString()
Valuepublic java.lang.String getSQL()
Valuepublic long getPrecision()
ValuegetPrecision in class Valuepublic int getDisplaySize()
ValuegetDisplaySize in class Valuepublic Value convertScale(boolean onlyToSmallerScale, int targetScale)
ValueconvertScale in class ValueonlyToSmallerScale - if the scale should not reducedtargetScale - the requested scaleprotected int compareSecure(Value o, CompareMode mode)
ValuecompareSecure in class Valueo - the other valuemode - the compare modepublic boolean equals(java.lang.Object other)
Valuepublic java.lang.Object getObject()
Valuepublic void set(java.sql.PreparedStatement prep,
int parameterIndex)
throws java.sql.SQLException
Valuepublic Value add(Value v)
Value