spring-framework / org.springframework.dao.support / DataAccessUtils / intResult

intResult

open static fun intResult(@Nullable results: MutableCollection<*>): Int

Return a unique int result from the given Collection. Throws an exception if 0 or more than 1 result objects found, of if the unique result object is not convertible to an int.

Parameters

results - the result Collection (can be null but is not expected to contain null elements)

Exceptions

IncorrectResultSizeDataAccessException - if more than one result object has been found in the given Collection

EmptyResultDataAccessException - if no result object at all has been found in the given Collection

TypeMismatchDataAccessException - if the unique object in the collection is not convertible to an int

Return
the unique int result