Interface TypeMapper<D,​R>

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default io.micronaut.core.convert.ConversionService<?> getConversionService()  
      R map​(D object, java.lang.Class<R> type)
      Map the given result set to the given object.
      default java.lang.Object read​(D object, io.micronaut.core.type.Argument<?> argument)
      Read a value for the given name from the given object.
      java.lang.Object read​(D object, java.lang.String name)
      Read a value for the given name from the given object.
    • Method Detail

      • map

        @NonNull
        R map​(@NonNull
              D object,
              @NonNull
              java.lang.Class<R> type)
        throws io.micronaut.data.exceptions.DataAccessException
        Map the given result set to the given object.
        Parameters:
        object - The object to map
        type - The type
        Returns:
        The mapped object
        Throws:
        io.micronaut.data.exceptions.DataAccessException - If the object cannot be mapped.
      • read

        @Nullable
        java.lang.Object read​(@NonNull
                              D object,
                              @NonNull
                              java.lang.String name)
        Read a value for the given name from the given object.
        Parameters:
        object - The object to read from
        name - The name
        Returns:
        The value
      • read

        @Nullable
        default java.lang.Object read​(@NonNull
                                      D object,
                                      @NonNull
                                      io.micronaut.core.type.Argument<?> argument)
        Read a value for the given name from the given object.
        Parameters:
        object - The object to read from
        argument - The argument
        Returns:
        The value
      • getConversionService

        @NonNull
        default io.micronaut.core.convert.ConversionService<?> getConversionService()
        Returns:
        The conversion service to use.