public class ValueMetaTimestamp extends ValueMetaDate
bigNumberFormatting, caseInsensitive, collator, collatorDisabled, collatorLocale, collatorStrength, comments, comparator, COMPATIBLE_DATE_FORMAT_PATTERN, compatibleDateFormat, conversionMask, conversionMetadata, currencySymbol, dateFormat, dateFormatChanged, dateFormatLenient, dateFormatLocale, dateFormatTimeZone, decimalFormat, decimalFormatChanged, decimalSymbol, DEFAULT_BIG_NUMBER_FORMAT_MASK, DEFAULT_BIGNUMBER_PARSE_MASK, DEFAULT_DATE_FORMAT_MASK, DEFAULT_DATE_PARSE_MASK, DEFAULT_INTEGER_FORMAT_MASK, DEFAULT_INTEGER_PARSE_MASK, DEFAULT_NUMBER_FORMAT_MASK, DEFAULT_NUMBER_PARSE_MASK, DEFAULT_TIMESTAMP_FORMAT_MASK, DEFAULT_TIMESTAMP_PARSE_MASK, emptyStringAndNullAreDifferent, groupingSymbol, identicalFormat, ignoreTimezone, ignoreWhitespace, index, largeTextField, length, lenientStringToNumber, name, numberOfBinaryStringConversions, origin, originalAutoIncrement, originalColumnType, originalColumnTypeName, originalNullable, originalPrecision, originalScale, originalSigned, outputPaddingEnabled, PKG, precision, SINGLE_BYTE_ENCODINGS, sortedDescending, storageMetadata, storageType, stringEncoding, trimType, trimTypeCode, trimTypeDesc, type, XML_DATA_TAG, XML_META_TAGDEFAULT_INTEGER_LENGTH, SORT_TYPE_ASCENDING, SORT_TYPE_DESCENDING, SORT_TYPE_NOT_SORTED, sortTypeCodes, STORAGE_TYPE_BINARY_STRING, STORAGE_TYPE_INDEXED, STORAGE_TYPE_NORMAL, storageTypeCodes, TRIM_TYPE_BOTH, TRIM_TYPE_LEFT, TRIM_TYPE_NONE, TRIM_TYPE_RIGHT, TYPE_BIGNUMBER, TYPE_BINARY, TYPE_BOOLEAN, TYPE_DATE, TYPE_INET, TYPE_INTEGER, TYPE_NONE, TYPE_NUMBER, TYPE_SERIALIZABLE, TYPE_STRING, TYPE_TIMESTAMP, typeCodes| Constructor and Description |
|---|
ValueMetaTimestamp() |
ValueMetaTimestamp(String name) |
| Modifier and Type | Method and Description |
|---|---|
Object |
cloneValueData(Object object)
Clones the data.
|
int |
compare(Object data1,
Object data2)
Compare 2 values of the same data type
|
protected Timestamp |
convertBigNumberToTimestamp(BigDecimal bd) |
Object |
convertData(ValueMetaInterface meta2,
Object data2)
Convert the specified data to the data type specified in this object.
|
Object |
convertDataFromString(String pol,
ValueMetaInterface convertMeta,
String nullIf,
String ifNull,
int trim_type)
Convert the specified string to the data type specified in this object.
|
Object |
convertDataUsingConversionMetaData(Object data2)
Convert an object to the data type specified in the conversion metadata
|
Timestamp |
convertDateToTimestamp(Date date) |
protected Timestamp |
convertIntegerToTimestamp(Long nanos) |
protected Timestamp |
convertNumberToTimestamp(Double d) |
protected Timestamp |
convertStringToTimestamp(String string) |
protected String |
convertTimestampToString(Timestamp timestamp) |
BigDecimal |
getBigNumber(Object object)
Convert the supplied data to a BigNumber
|
byte[] |
getBinaryString(Object object)
convert the supplied data to a binary string representation (for writing text)
|
Boolean |
getBoolean(Object object)
Convert the supplied data to a Boolean
|
Date |
getDate(Object object)
Convert the supplied data to a Date
|
SimpleDateFormat |
getDateFormat()
Gets the date format.
|
String |
getFormatMask()
Gets a formatting mask using this value's meta information.
|
Long |
getInteger(Object object)
Convert the supplied data to an Integer
|
ValueMetaInterface |
getMetadataPreview(DatabaseMeta databaseMeta,
ResultSet rs)
This is a similar method to getValueFromSQLType, but it uses a
ResultSet from a call to DatabaseMetaData#getColumns(String, String, String, String)
The ResultSet must be positioned correctly on the row to read.
|
Class<?> |
getNativeDataTypeClass()
Return the Java class that represents the "native" storage type of this ValueMeta
|
Double |
getNumber(Object object)
Convert the supplied data to a Number
|
String |
getString(Object object)
Convert the supplied data to a String
|
Timestamp |
getTimestamp(Object object) |
Object |
getValueFromResultSet(DatabaseInterface databaseInterface,
ResultSet resultSet,
int index)
Get a value from a result set column based on the current value metadata
|
ValueMetaInterface |
getValueFromSQLType(DatabaseMeta databaseMeta,
String name,
ResultSetMetaData rm,
int index,
boolean ignoreLength,
boolean lazyConversion)
Investigate JDBC result set metadata at the specified index.
|
boolean |
isDate()
Checks whether or not this value is a Date
|
Object |
readData(DataInputStream inputStream)
De-serialize data from an inputstream.
|
void |
setPreparedStatementValue(DatabaseMeta databaseMeta,
PreparedStatement preparedStatement,
int index,
Object data)
Set a value on a JDBC prepared statement on the specified position
|
void |
writeData(DataOutputStream outputStream,
Object object)
Serialize the content of the specified data object to the outputStream.
|
getNativeDataTypeclone, compare, compareStorageAndActualFormat, convertBigNumberToBoolean, convertBigNumberToDate, convertBigNumberToString, convertBinaryStringToNativeType, convertBinaryStringToString, convertBooleanToBigNumber, convertBooleanToInteger, convertBooleanToNumber, convertBooleanToString, convertDataCompatible, convertDateToBigNumber, convertDateToCompatibleString, convertDateToInteger, convertDateToNumber, convertDateToString, convertIntegerToBoolean, convertIntegerToCompatibleString, convertIntegerToDate, convertIntegerToString, convertNormalStorageTypeToBinaryString, convertNumberToBoolean, convertNumberToCompatibleString, convertNumberToDate, convertNumberToString, convertStringToBigNumber, convertStringToBinaryString, convertStringToBoolean, convertStringToDate, convertStringToInteger, convertStringToNumber, convertToBinaryStringStorageType, convertToNormalStorageType, createOriginalValue, determineSingleByteEncoding, drawValue, getAllTypes, getBinary, getCollatorLocale, getCollatorStrength, getComments, getCompatibleString, getConversionMask, getConversionMetadata, getCurrencySymbol, getDatabaseColumnTypeDefinition, getDataXML, getDateFormatLocale, getDateFormatTimeZone, getDecimalFormat, getDecimalFormat, getDecimalSymbol, getGroupingSymbol, getIndex, getLength, getMetaXML, getName, getNumberOfBinaryStringConversions, getOrigin, getOriginalColumnMetadata, getOriginalColumnType, getOriginalColumnTypeName, getOriginalNullable, getOriginalPrecision, getOriginalScale, getOriginalSigned, getPrecision, getQuotesBeforeSymbol, getStorageMetadata, getStorageType, getStorageType, getStorageTypeCode, getStorageTypeDesc, getStringEncoding, getTrimType, getTrimTypeByCode, getTrimTypeByDesc, getTrimTypeCode, getTrimTypeCodes, getTrimTypeDesc, getTrimTypeDescriptions, getType, getType, getTypeDesc, getTypeDesc, getTypes, getValue, getValueData, hashCode, isBigNumber, isBigNumberFormatting, isBinary, isBoolean, isCaseInsensitive, isCollatorDisabled, isDateFormatLenient, isIgnoreWhitespace, isInteger, isLargeTextField, isLenientStringToNumber, isNull, isNumber, isNumeric, isNumeric, isOriginalAutoIncrement, isOriginalNullable, isOriginalSigned, isOutputPaddingEnabled, isSerializableType, isSingleByteEncoding, isSortedAscending, isSortedDescending, isStorageBinaryString, isStorageIndexed, isStorageNormal, isString, readBigNumber, readBinary, readBinaryString, readBoolean, readDate, readInteger, readMetaData, readNumber, readSmallInteger, readString, requiresRealClone, setBigNumberFormatting, setCaseInsensitive, setCollatorDisabled, setCollatorLocale, setCollatorStrength, setComments, setConversionMask, setConversionMetadata, setCurrencySymbol, setDateFormatLenient, setDateFormatLocale, setDateFormatTimeZone, setDecimalSymbol, setDefaultConversionMask, setGroupingSymbol, setIgnoreWhitespace, setIndex, setLargeTextField, setLength, setLength, setLenientStringToNumber, setName, setNumberOfBinaryStringConversions, setOrigin, setOriginalAutoIncrement, setOriginalColumnType, setOriginalColumnTypeName, setOriginalNullable, setOriginalPrecision, setOriginalScale, setOriginalSigned, setOutputPaddingEnabled, setPrecision, setSortedDescending, setStorageMetadata, setStorageType, setStringEncoding, setTrimType, setType, toString, toStringMeta, trim, writeBigNumber, writeBinary, writeBinaryString, writeBoolean, writeDate, writeInteger, writeInteger, writeMeta, writeNumber, writeStringequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitclone, compare, convertBinaryStringToNativeType, convertDataCompatible, convertNormalStorageTypeToBinaryString, convertToBinaryStringStorageType, convertToNormalStorageType, createOriginalValue, drawValue, getBinary, getCollatorLocale, getCollatorStrength, getComments, getCompatibleString, getConversionMask, getConversionMetadata, getCurrencySymbol, getDatabaseColumnTypeDefinition, getDataXML, getDateFormatLocale, getDateFormatTimeZone, getDecimalFormat, getDecimalFormat, getDecimalSymbol, getGroupingSymbol, getIndex, getLength, getMetaXML, getName, getNumberOfBinaryStringConversions, getOrigin, getOriginalColumnType, getOriginalColumnTypeName, getOriginalNullable, getOriginalPrecision, getOriginalScale, getOriginalSigned, getPrecision, getStorageMetadata, getStorageType, getStringEncoding, getTrimType, getType, getTypeCode, getTypeDesc, getTypeDescription, getValue, getValueData, hashCode, isBigNumber, isBinary, isBoolean, isCaseInsensitive, isCollatorDisabled, isDateFormatLenient, isIgnoreWhitespace, isInteger, isLargeTextField, isLenientStringToNumber, isNull, isNumber, isNumeric, isOriginalAutoIncrement, isOriginalNullable, isOriginalSigned, isOutputPaddingEnabled, isSerializableType, isSingleByteEncoding, isSortedDescending, isStorageBinaryString, isStorageIndexed, isStorageNormal, isString, readMetaData, requiresRealClone, setCaseInsensitive, setCollatorDisabled, setCollatorLocale, setCollatorStrength, setComments, setConversionMask, setConversionMetadata, setCurrencySymbol, setDateFormatLenient, setDateFormatLocale, setDateFormatTimeZone, setDecimalSymbol, setGroupingSymbol, setIgnoreWhitespace, setIndex, setLargeTextField, setLength, setLength, setLenientStringToNumber, setName, setNumberOfBinaryStringConversions, setOrigin, setOriginalAutoIncrement, setOriginalColumnType, setOriginalColumnTypeName, setOriginalNullable, setOriginalPrecision, setOriginalScale, setOriginalSigned, setOutputPaddingEnabled, setPrecision, setSortedDescending, setStorageMetadata, setStorageType, setStringEncoding, setTrimType, setType, toStringMeta, writeMetapublic ValueMetaTimestamp()
public ValueMetaTimestamp(String name)
public boolean isDate()
ValueMetaBaseisDate in interface ValueMetaInterfaceisDate in class ValueMetaBasepublic Date getDate(Object object) throws KettleValueException
ValueMetaInterfacegetDate in interface ValueMetaInterfacegetDate in class ValueMetaDateKettleValueExceptionpublic Long getInteger(Object object) throws KettleValueException
ValueMetaInterfacegetInteger in interface ValueMetaInterfacegetInteger in class ValueMetaBaseKettleValueExceptionpublic Double getNumber(Object object) throws KettleValueException
ValueMetaInterfacegetNumber in interface ValueMetaInterfacegetNumber in class ValueMetaBaseKettleValueExceptionpublic BigDecimal getBigNumber(Object object) throws KettleValueException
ValueMetaInterfacegetBigNumber in interface ValueMetaInterfacegetBigNumber in class ValueMetaBaseKettleValueExceptionpublic Boolean getBoolean(Object object) throws KettleValueException
ValueMetaInterfacegetBoolean in interface ValueMetaInterfacegetBoolean in class ValueMetaBaseKettleValueExceptionpublic String getString(Object object) throws KettleValueException
ValueMetaInterfacegetString in interface ValueMetaInterfacegetString in class ValueMetaBaseKettleValueExceptionpublic Timestamp getTimestamp(Object object) throws KettleValueException
KettleValueExceptionpublic int compare(Object data1, Object data2) throws KettleValueException
ValueMetaBasecompare in interface ValueMetaInterfacecompare in class ValueMetaBasedata1 - the first valuedata2 - the second valueKettleValueException - In case we get conversion errorsprotected Timestamp convertBigNumberToTimestamp(BigDecimal bd)
protected Timestamp convertStringToTimestamp(String string) throws KettleValueException
KettleValueExceptionprotected String convertTimestampToString(Timestamp timestamp) throws KettleValueException
KettleValueExceptionpublic Object convertDataFromString(String pol, ValueMetaInterface convertMeta, String nullIf, String ifNull, int trim_type) throws KettleValueException
ValueMetaBaseconvertDataFromString in interface ValueMetaInterfaceconvertDataFromString in class ValueMetaBasepol - the string to be convertedconvertMeta - the metadata of the object (only string type) to be convertednullIf - set the object to null if pos equals nullif (IgnoreCase)ifNull - set the object to ifNull when pol is empty or nulltrim_type - the trim type to be used (ValueMetaInterface.TRIM_TYPE_XXX)KettleValueException - in case there is a data conversion errorpublic Timestamp convertDateToTimestamp(Date date) throws KettleValueException
KettleValueExceptionpublic Object convertData(ValueMetaInterface meta2, Object data2) throws KettleValueException
convertData in interface ValueMetaInterfaceconvertData in class ValueMetaBasemeta2 - the metadata of the object to be converteddata2 - the data of the object to be convertedKettleValueException - in case there is a data conversion errorpublic Object cloneValueData(Object object) throws KettleValueException
ValueMetaBasecloneValueData in interface ValueMetaInterfacecloneValueData in class ValueMetaBaseobject - the objectKettleValueException - the kettle value exceptionpublic ValueMetaInterface getMetadataPreview(DatabaseMeta databaseMeta, ResultSet rs) throws KettleDatabaseException
ValueMetaInterfaceNote that the ValueMeta returned by this RowMeta may not contain actual values. This is a lightweight call using only JDBC metadata and does not make use of SQL statements.
getMetadataPreview in interface ValueMetaInterfacegetMetadataPreview in class ValueMetaBasedatabaseMeta - the database metadata to reference capabilities and so on.rs - A ResultSet from getColumns, positioned correctly on a column to read.KettleDatabaseExceptionpublic ValueMetaInterface getValueFromSQLType(DatabaseMeta databaseMeta, String name, ResultSetMetaData rm, int index, boolean ignoreLength, boolean lazyConversion) throws KettleDatabaseException
ValueMetaInterfacegetValueFromSQLType in interface ValueMetaInterfacegetValueFromSQLType in class ValueMetaBasedatabaseMeta - the database metadata to reference capabilities and so on.name - The name of the new valuerm - The result metadata to investigateindex - The index to look at (1-based)ignoreLength - Don't look at the lengthlazyConversion - use lazy conversionKettleDatabaseException - In case something went wrong.public Object getValueFromResultSet(DatabaseInterface databaseInterface, ResultSet resultSet, int index) throws KettleDatabaseException
ValueMetaBasegetValueFromResultSet in interface ValueMetaInterfacegetValueFromResultSet in class ValueMetaBasedatabaseInterface - the database metadata to useresultSet - The JDBC result set to read fromindex - The column index (1-based)KettleDatabaseException - in case something goes wrong.public void setPreparedStatementValue(DatabaseMeta databaseMeta, PreparedStatement preparedStatement, int index, Object data) throws KettleDatabaseException
ValueMetaInterfacesetPreparedStatementValue in interface ValueMetaInterfacesetPreparedStatementValue in class ValueMetaBasedatabaseMeta - the database metadata to referencepreparedStatement - The prepared statementindex - the column index (1-based)data - the value to setKettleDatabaseException - in case something goes wrongpublic Object convertDataUsingConversionMetaData(Object data2) throws KettleValueException
ValueMetaBaseconvertDataUsingConversionMetaData in interface ValueMetaInterfaceconvertDataUsingConversionMetaData in class ValueMetaBasedata2 - The dataKettleValueException - in case there is a conversion error.public byte[] getBinaryString(Object object) throws KettleValueException
ValueMetaInterfacegetBinaryString in interface ValueMetaInterfacegetBinaryString in class ValueMetaBaseKettleValueExceptionpublic void writeData(DataOutputStream outputStream, Object object) throws KettleFileException
ValueMetaInterfacewriteData in interface ValueMetaInterfacewriteData in class ValueMetaBaseoutputStream - the outputstream to write toobject - the data object to serializeKettleFileException - in case a I/O error occurspublic Object readData(DataInputStream inputStream) throws KettleFileException, KettleEOFException, SocketTimeoutException
ValueMetaInterfacereadData in interface ValueMetaInterfacereadData in class ValueMetaBaseinputStream - the input stream to read fromKettleFileException - in case a I/O error occursKettleEOFException - When we have read all the data there is to readSocketTimeoutException - In case there is a timeout (when set on a socket) during readingpublic SimpleDateFormat getDateFormat()
ValueMetaInterfacegetDateFormat in interface ValueMetaInterfacegetDateFormat in class ValueMetaBasepublic String getFormatMask()
ValueMetaInterfacegetFormatMask in interface ValueMetaInterfacegetFormatMask in class ValueMetaDatepublic Class<?> getNativeDataTypeClass() throws KettleValueException
ValueMetaInterfacegetNativeDataTypeClass in interface ValueMetaInterfacegetNativeDataTypeClass in class ValueMetaDateKettleValueExceptionCopyright © 2019 Hitachi Vantara. All rights reserved.