Interface LdapClient.MappedSearchSpec<T extends @Nullable Object>

Type Parameters:
T - the mapped result type
Enclosing interface:
LdapClient

public static interface LdapClient.MappedSearchSpec<T extends @Nullable Object>
A specification for retrieving mapped search results with various cardinality options.
Since:
4.1
  • Method Summary

    Modifier and Type
    Method
    Description
    Retrieve the result as a pre-resolved list of mapped objects, retaining the order from the original database result.
    default Optional<T>
    Retrieve a single result, if available, as an Optional handle.
    default Set<T>
    set()
    Retrieve the result as an order-preserving set of mapped objects.
    default @NonNull T
    Retrieve a single result as a required object instance.
    Retrieve the result as a lazily resolved stream of mapped objects, retaining the order from the original database result.
  • Method Details

    • stream

      Stream<T> stream()
      Retrieve the result as a lazily resolved stream of mapped objects, retaining the order from the original database result.
      Returns:
      the result Stream, containing mapped objects, needing to be closed once fully processed (for example, through a try-with-resources clause)
    • list

      List<T> list()
      Retrieve the result as a pre-resolved list of mapped objects, retaining the order from the original database result.
      Returns:
      the result as a detached List, containing mapped objects
    • set

      default Set<T> set()
      Retrieve the result as an order-preserving set of mapped objects.
      Returns:
      the result as a detached Set, containing mapped objects
      See Also:
    • single

      default @NonNull T single()
      Retrieve a single result as a required object instance.
      Returns:
      the single result object (never null)
      See Also:
      • optional()
      • DataAccessUtils.requiredSingleResult(Collection)
    • optional

      default Optional<T> optional()
      Retrieve a single result, if available, as an Optional handle.
      Returns:
      an Optional handle with a single result object or none
      See Also:
      • single()
      • DataAccessUtils.optionalResult(Collection)