Deprecated
for removal since 3.15.
- 3.15.0 - [#11898] This class will be removed in the future. Do
not reuse. Data type conversion happens using internal
Converter implementations, or ConverterProvider
provided ones, or implementations attached to fields via
generated code, or via Field#convert(Converter), or
DataType#asConvertedDataType(Converter).
This class provides less type-safety than the general jOOQ API methods. For
instance, it accepts arbitrary Converter objects in methods like
convert(Collection, Converter) and convert(Object, Class),
trying to retrofit the Object argument to the type provided in
Converter#fromType() before performing the actual conversion.
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| public static final Set | FALSE_VALUES
All string values that can be transformed into a boolean |
| private static final boolean | JAXB_AVAILABLE
Whether a JAXB implementation is available. |
| private static final Object | JSON_MAPPER
The Jackson ObjectMapper or Gson instance, if available. |
| private static final Method | JSON_READ_METHOD
The Jackson ObjectMapper::readValue or Gson::fromJson method, if available. |
| private static final Method | JSON_WRITE_METHOD
The Jackson ObjectMapper::writeValueToString or Gson::toJson method, if available. |
| private static final JooqLogger | |
| public static final Set | TRUE_VALUES
All string values that can be transformed into a boolean |
| private static final Pattern | UUID_PATTERN
A UUID pattern for UUIDs with or without hyphens |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static final Object[] | |
| public static final Object[] | |
| public static final <U> U | |
| public static final <T> T | |
| public static final <T> List | Returns: The list of converted objectsThe list of objects collection, Class<? extends T> The target type type)Convert a collection of objects to a list of |
| public static final <U> List | Returns: The list of converted objectsThe collection of objects collection, Converter<?, ? extends U> The data type converter converter)Convert a collection of objects to a list of |
| private static final <T, U> U | |
| private static final <T, U> List | |
| public static final <U> U[] | Returns: A converted arrayThe array to convert from, Converter<?, ? extends U> The data type converter converter)Convert an array into another one using a converter
This uses |
| public static final Object[] | Returns: A converted arrayThe array to convert from, Class<?> The target array type toClass)Convert an array into another one by these rules
|
| public static final <U> U[] |
| FALSE_VALUES | back to summary |
|---|---|
| public static final Set<String> FALSE_VALUES All string values that can be transformed into a boolean | |
| JAXB_AVAILABLE | back to summary |
|---|---|
| private static final boolean JAXB_AVAILABLE Whether a JAXB implementation is available. | |
| JSON_MAPPER | back to summary |
|---|---|
| private static final Object JSON_MAPPER The Jackson ObjectMapper or Gson instance, if available. | |
| JSON_READ_METHOD | back to summary |
|---|---|
| private static final Method JSON_READ_METHOD The Jackson ObjectMapper::readValue or Gson::fromJson method, if available. | |
| JSON_WRITE_METHOD | back to summary |
|---|---|
| private static final Method JSON_WRITE_METHOD The Jackson ObjectMapper::writeValueToString or Gson::toJson method, if available. | |
| log | back to summary |
|---|---|
| private static final JooqLogger log | |
| TRUE_VALUES | back to summary |
|---|---|
| public static final Set<String> TRUE_VALUES All string values that can be transformed into a boolean | |
| UUID_PATTERN | back to summary |
|---|---|
| private static final Pattern UUID_PATTERN A UUID pattern for UUIDs with or without hyphens | |
| Convert | back to summary |
|---|---|
| private Convert() No instances | |
| convert | back to summary |
|---|---|
| public static final Object[] convert(Object[] values, Field<?>[] fields)
Deprecated as a consequence of Convert an array of values to a matching data type
This converts | |
| convert | back to summary |
|---|---|
| public static final Object[] convert(Object[] values, Class<?>[] types) Convert an array of values to a matching data type
This converts | |
| convert | back to summary |
|---|---|
| public static final <U> U convert(Object from, Converter<?, ? extends U> converter) throws DataTypeException Convert an object to a type.
| |
| convert | back to summary |
|---|---|
| public static final <T> T convert(Object from, Class<? extends T> toClass) throws DataTypeException Convert an object to a type. These are the conversion rules:
| |
| convert | back to summary |
|---|---|
| public static final <T> List Convert a collection of objects to a list of
| |
| convert | back to summary |
|---|---|
| public static final <U> List Convert a collection of objects to a list of
| |
| convert0 | back to summary |
|---|---|
| private static final <T, U> U convert0(Object from, Converter<T, ? extends U> converter) throws DataTypeException Conversion type-safety
| |
| convert0 | back to summary |
|---|---|
| private static final <T, U> List Type safe conversion | |
| convertArray | back to summary |
|---|---|
| public static final <U> U[] convertArray(Object[] from, Converter<?, ? extends U> converter) throws DataTypeException Convert an array into another one using a converter
This uses
| |
| convertArray | back to summary |
|---|---|
| public static final Object[] convertArray(Object[] from, Class<?> toClass) throws DataTypeException Convert an array into another one by these rules
| |
| convertCollection | back to summary |
|---|---|
| public static final <U> U[] convertCollection(Collection<E> from, Class<? extends U[]> to) | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final Pattern | |
| private final Class |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| private static DataTypeException | |
| public U | from(Object
The database object. from, ConverterContext The context of this conversion. scope)Implements org. |
| private static final long | |
| private static final UUID | |
| pack-priv static final String | |
| private static final String | |
| private static final String | |
| public Object | to(U
The user object. to, ConverterContext The context of this conversion. scope)Implements org. |
| private static <X> X | |
| private static <X> X | |
| private static Timestamp |
| P_FRACTIONAL_SECONDS | back to summary |
|---|---|
| pack-priv static final Pattern P_FRACTIONAL_SECONDS | |
| toClass | back to summary |
|---|---|
| private final Class<? extends U> toClass | |
| ConvertAll | back to summary |
|---|---|
pack-priv ConvertAll(Class<? extends U> toClass)
| |
| fail | back to summary |
|---|---|
| private static DataTypeException fail(Object from, Class<?> toClass) | |
| from | back to summary |
|---|---|
| public U from(Object from, ConverterContext scope) Implements org. Doc from org. Read and convert a database object to a user object.
| |
| millis | back to summary |
|---|---|
| private static final long millis(Temporal temporal) | |
| parseUUID | back to summary |
|---|---|
| private static final UUID parseUUID(String string) Some databases do not implement the standard very well. Specifically,
| |
| patchFractionalSeconds | back to summary |
|---|---|
| pack-priv static final String patchFractionalSeconds(String string) | |
| patchIso8601Time | back to summary |
|---|---|
| private static final String patchIso8601Time(String string) | |
| patchIso8601Timestamp | back to summary |
|---|---|
| private static final String patchIso8601Timestamp(String string, boolean t) | |
| to | back to summary |
|---|---|
| public Object to(U to, ConverterContext scope) Implements org. Doc from org. Convert and write a user object to a database object.
| |
| toDate | back to summary |
|---|---|
| private static <X> X toDate(long time, Class<X> toClass) Convert a long timestamp (millis) to any date type. | |
| toDate | back to summary |
|---|---|
| private static <X> X toDate(long time, int nanos, Class<X> toClass) Convert a long timestamp (millis) with nanos adjustment to any date type.
| |
| toTimestamp | back to summary |
|---|---|
| private static Timestamp toTimestamp(long time, int nanos) | |