Class EnumMapper.EnumByOrdinalColumnMapper<E extends java.lang.Enum<E>>

  • All Implemented Interfaces:
    ColumnMapper<E>
    Enclosing class:
    EnumMapper<E extends java.lang.Enum<E>>

    static class EnumMapper.EnumByOrdinalColumnMapper<E extends java.lang.Enum<E>>
    extends java.lang.Object
    implements ColumnMapper<E>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.Class<E> enumClass  
      private E[] enumConstants  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private EnumByOrdinalColumnMapper​(java.lang.Class<E> enumClass)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      E map​(java.sql.ResultSet rs, int columnNumber, StatementContext ctx)
      Map the given column of the current row of the result set to an Object.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • enumClass

        private final java.lang.Class<E extends java.lang.Enum<E>> enumClass
      • enumConstants

        private final E extends java.lang.Enum<E>[] enumConstants
    • Constructor Detail

      • EnumByOrdinalColumnMapper

        private EnumByOrdinalColumnMapper​(java.lang.Class<E> enumClass)
    • Method Detail

      • map

        public E map​(java.sql.ResultSet rs,
                     int columnNumber,
                     StatementContext ctx)
              throws java.sql.SQLException
        Description copied from interface: ColumnMapper
        Map the given column of the current row of the result set to an Object. This method should not cause the result set to advance; allow Jdbi to do that, please.
        Specified by:
        map in interface ColumnMapper<E extends java.lang.Enum<E>>
        Parameters:
        rs - the result set being iterated
        columnNumber - the column number to map (starts at 1)
        ctx - the statement context
        Returns:
        the value to return for this column
        Throws:
        java.sql.SQLException - if anything goes wrong go ahead and let this percolate; Jdbi will handle it