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 PropertySet
pset
-
Constructor Summary
Constructors Constructor Description StringValueFactory(PropertySet pset)
-
Method Summary
Modifier and Type Method Description java.lang.String
createFromBigDecimal(java.math.BigDecimal d)
java.lang.String
createFromBigInteger(java.math.BigInteger i)
java.lang.String
createFromBit(byte[] bytes, int offset, int length)
java.lang.String
createFromBytes(byte[] bytes, int offset, int length, Field f)
Interpret the given byte array as a string.java.lang.String
createFromDate(InternalDate idate)
Create a string from InternalDate.java.lang.String
createFromDatetime(InternalTimestamp its)
Create a string from time fields.java.lang.String
createFromDouble(double d)
java.lang.String
createFromLong(long l)
java.lang.String
createFromNull()
Create result value from intermediate null value.java.lang.String
createFromTime(InternalTime it)
Create a string from InternalTime.java.lang.String
createFromTimestamp(InternalTimestamp its)
Create a string from time fields.java.lang.String
createFromYear(long l)
java.lang.String
getTargetTypeName()
Get the actual class name of T parameter.void
setPropertySet(PropertySet pset)
-
Field Details
-
Constructor Details
-
Method Details
-
setPropertySet
- Specified by:
setPropertySet
in interfaceValueFactory<java.lang.String>
-
createFromDate
Create a string from InternalDate. The fields are formatted in a YYYY-mm-dd format.- Specified by:
createFromDate
in 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:
createFromTime
in 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:
createFromTimestamp
in 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:
createFromDatetime
in interfaceValueFactory<java.lang.String>
- Parameters:
its
-InternalTimestamp
- Returns:
- string
-
createFromLong
public java.lang.String createFromLong(long l)- Specified by:
createFromLong
in interfaceValueFactory<java.lang.String>
-
createFromBigInteger
public java.lang.String createFromBigInteger(java.math.BigInteger i)- Specified by:
createFromBigInteger
in interfaceValueFactory<java.lang.String>
-
createFromDouble
public java.lang.String createFromDouble(double d)- Specified by:
createFromDouble
in interfaceValueFactory<java.lang.String>
-
createFromBigDecimal
public java.lang.String createFromBigDecimal(java.math.BigDecimal d)- Specified by:
createFromBigDecimal
in 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:
createFromBytes
in 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:
createFromBit
in interfaceValueFactory<java.lang.String>
-
createFromYear
public java.lang.String createFromYear(long l)- Specified by:
createFromYear
in interfaceValueFactory<java.lang.String>
-
createFromNull
public java.lang.String createFromNull()Description copied from interface:ValueFactory
Create result value from intermediate null value.- Specified by:
createFromNull
in interfaceValueFactory<java.lang.String>
- Returns:
- T object
-
getTargetTypeName
public java.lang.String getTargetTypeName()Description copied from interface:ValueFactory
Get the actual class name of T parameter.- Specified by:
getTargetTypeName
in interfaceValueFactory<java.lang.String>
- Returns:
- class name
-