Class EnumMapper.EnumByNameColumnMapper<E extends Enum<E>>

java.lang.Object
org.jdbi.v3.core.mapper.EnumMapper.EnumByNameColumnMapper<E>
All Implemented Interfaces:
ColumnMapper<E>
Enclosing class:
EnumMapper<E extends Enum<E>>

static class EnumMapper.EnumByNameColumnMapper<E extends Enum<E>> extends Object implements ColumnMapper<E>
  • Field Details

  • Constructor Details

    • EnumByNameColumnMapper

      private EnumByNameColumnMapper(Class<E> enumClass)
  • Method Details

    • map

      public E map(ResultSet rs, int columnNumber, StatementContext ctx) throws 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 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:
      SQLException - if anything goes wrong go ahead and let this percolate; Jdbi will handle it
    • getValueByName

      private static Object getValueByName(Class<? extends Enum<?>> enumClass, String name)
    • enumValueMatches

      private static Predicate<Enum<?>> enumValueMatches(String name, BiPredicate<String,String> comparer)
    • enumConstants

      private static Stream<Enum<?>> enumConstants(Class<? extends Enum<?>> enumClass)