Package com.mysql.cj.result
Class StringValueFactory
java.lang.Object
com.mysql.cj.result.StringValueFactory
- All Implemented Interfaces:
ValueFactory<java.lang.String>
public class StringValueFactory extends java.lang.Object implements ValueFactory<java.lang.String>
A
ValueFactory implementation to create strings.-
Field Summary
Fields Modifier and Type Field Description protected PropertySetpset -
Constructor Summary
Constructors Constructor Description StringValueFactory(PropertySet pset) -
Method Summary
Modifier and Type Method Description java.lang.StringcreateFromBigDecimal(java.math.BigDecimal d)java.lang.StringcreateFromBigInteger(java.math.BigInteger i)java.lang.StringcreateFromBit(byte[] bytes, int offset, int length)java.lang.StringcreateFromBytes(byte[] bytes, int offset, int length, Field f)Interpret the given byte array as a string.java.lang.StringcreateFromDate(InternalDate idate)Create a string from InternalDate.java.lang.StringcreateFromDatetime(InternalTimestamp its)Create a string from time fields.java.lang.StringcreateFromDouble(double d)java.lang.StringcreateFromLong(long l)java.lang.StringcreateFromNull()Create result value from intermediate null value.java.lang.StringcreateFromTime(InternalTime it)Create a string from InternalTime.java.lang.StringcreateFromTimestamp(InternalTimestamp its)Create a string from time fields.java.lang.StringcreateFromYear(long l)java.lang.StringgetTargetTypeName()Get the actual class name of T parameter.voidsetPropertySet(PropertySet pset)
-
Field Details
-
Constructor Details
-
Method Details
-
setPropertySet
- Specified by:
setPropertySetin interfaceValueFactory<java.lang.String>
-
createFromDate
Create a string from InternalDate. The fields are formatted in a YYYY-mm-dd format.- Specified by:
createFromDatein interfaceValueFactory<java.lang.String>- Parameters:
idate-InternalDate- Returns:
- string
-
createFromTime
Create a string from InternalTime. The fields are formatted in a HH:MM:SS[.nnnnnnnnn] format.- Specified by:
createFromTimein interfaceValueFactory<java.lang.String>- Parameters:
it-InternalTime- Returns:
- string
-
createFromTimestamp
Create a string from time fields. The fields are formatted by concatenating the result ofcreateFromDate(InternalDate)andcreateFromTime(InternalTime).- Specified by:
createFromTimestampin interfaceValueFactory<java.lang.String>- Parameters:
its-InternalTimestamp- Returns:
- string
-
createFromDatetime
Create a string from time fields. The fields are formatted by concatenating the result ofcreateFromDate(InternalDate)andcreateFromTime(InternalTime).- Specified by:
createFromDatetimein interfaceValueFactory<java.lang.String>- Parameters:
its-InternalTimestamp- Returns:
- string
-
createFromLong
public java.lang.String createFromLong(long l)- Specified by:
createFromLongin interfaceValueFactory<java.lang.String>
-
createFromBigInteger
public java.lang.String createFromBigInteger(java.math.BigInteger i)- Specified by:
createFromBigIntegerin interfaceValueFactory<java.lang.String>
-
createFromDouble
public java.lang.String createFromDouble(double d)- Specified by:
createFromDoublein interfaceValueFactory<java.lang.String>
-
createFromBigDecimal
public java.lang.String createFromBigDecimal(java.math.BigDecimal d)- Specified by:
createFromBigDecimalin interfaceValueFactory<java.lang.String>
-
createFromBytes
Interpret the given byte array as a string. This value factory needs to know the encoding to interpret the string. The default (null) will interpret the byte array using the platform encoding.- Specified by:
createFromBytesin interfaceValueFactory<java.lang.String>- Parameters:
bytes- byte arrayoffset- offsetlength- data length in bytesf- field- Returns:
- string
-
createFromBit
public java.lang.String createFromBit(byte[] bytes, int offset, int length)- Specified by:
createFromBitin interfaceValueFactory<java.lang.String>
-
createFromYear
public java.lang.String createFromYear(long l)- Specified by:
createFromYearin interfaceValueFactory<java.lang.String>
-
createFromNull
public java.lang.String createFromNull()Description copied from interface:ValueFactoryCreate result value from intermediate null value.- Specified by:
createFromNullin interfaceValueFactory<java.lang.String>- Returns:
- T object
-
getTargetTypeName
public java.lang.String getTargetTypeName()Description copied from interface:ValueFactoryGet the actual class name of T parameter.- Specified by:
getTargetTypeNamein interfaceValueFactory<java.lang.String>- Returns:
- class name
-