Package org.jdbi.v3.core.array
Class SqlArrayTypeImpl<T>
- java.lang.Object
-
- org.jdbi.v3.core.array.SqlArrayTypeImpl<T>
-
- All Implemented Interfaces:
SqlArrayType<T>
class SqlArrayTypeImpl<T> extends java.lang.Object implements SqlArrayType<T>
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.function.Function<T,?>conversionprivate java.lang.StringtypeName
-
Constructor Summary
Constructors Constructor Description SqlArrayTypeImpl(java.lang.String typeName, java.util.function.Function<T,?> conversion)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ObjectconvertArrayElement(T element)Returns an equivalent value in a type supported by the JDBC vendor.java.lang.StringgetTypeName()Returns the vendor-specific SQL type nameStringfor the element typeT.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jdbi.v3.core.array.SqlArrayType
getArrayElementClass
-
-
-
-
Field Detail
-
typeName
private final java.lang.String typeName
-
conversion
private final java.util.function.Function<T,?> conversion
-
-
Constructor Detail
-
SqlArrayTypeImpl
SqlArrayTypeImpl(java.lang.String typeName, java.util.function.Function<T,?> conversion)
-
-
Method Detail
-
getTypeName
public java.lang.String getTypeName()
Description copied from interface:SqlArrayTypeReturns the vendor-specific SQL type nameStringfor the element typeT. This value will be passed toConnection.createArrayOf(String, Object[])to create SQL arrays.- Specified by:
getTypeNamein interfaceSqlArrayType<T>- Returns:
- the type name
-
convertArrayElement
public java.lang.Object convertArrayElement(T element)
Description copied from interface:SqlArrayTypeReturns an equivalent value in a type supported by the JDBC vendor. If element typeTis already supported by the JDBC vendor, this method may returnelementwithout modification.- Specified by:
convertArrayElementin interfaceSqlArrayType<T>- Parameters:
element- the element to convert- Returns:
- the converted element
-
-