Interface DocumentMapper<T>

Type Parameters:
T - The type of the resulting object.
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface DocumentMapper<T>
A functional interface for mapping a BSON Document to a Java object.
  • Method Summary

    Modifier and Type
    Method
    Description
    map(org.bson.Document doc)
    Maps the provided BSON document to an object of type T.
  • Method Details

    • map

      T map(org.bson.Document doc) throws Exception
      Maps the provided BSON document to an object of type T.
      Parameters:
      doc - The source BSON document.
      Returns:
      The mapped object.
      Throws:
      Exception - If mapping logic fails.