Class 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,​?> conversion  
      private java.lang.String typeName  
    • 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.Object convertArrayElement​(T element)
      Returns an equivalent value in a type supported by the JDBC vendor.
      java.lang.String getTypeName()
      Returns the vendor-specific SQL type name String for the element type T.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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: SqlArrayType
        Returns the vendor-specific SQL type name String for the element type T. This value will be passed to Connection.createArrayOf(String, Object[]) to create SQL arrays.
        Specified by:
        getTypeName in interface SqlArrayType<T>
        Returns:
        the type name
      • convertArrayElement

        public java.lang.Object convertArrayElement​(T element)
        Description copied from interface: SqlArrayType
        Returns an equivalent value in a type supported by the JDBC vendor. If element type T is already supported by the JDBC vendor, this method may return element without modification.
        Specified by:
        convertArrayElement in interface SqlArrayType<T>
        Parameters:
        element - the element to convert
        Returns:
        the converted element