org.springframework.ldap.core

## Class AttributesMapperCallbackHandler<T>

- java.lang.Object
- - org.springframework.ldap.core.CollectingNameClassPairCallbackHandler<T>
  - - org.springframework.ldap.core.AttributesMapperCallbackHandler<T>

- All Implemented Interfaces:
    NameClassPairCallbackHandler

      public class AttributesMapperCallbackHandler<T>
      extends CollectingNameClassPairCallbackHandler<T>

  A CollectingNameClassPairCallbackHandler to wrap an `AttributesMapper`. That is, the found object is extracted from the `Attributes` of each `SearchResult`, and then passed to the specified `AttributesMapper` for translation.
  Since:
    1.2
  Author:
    Mattias Hellborg Arthursson, Ulrik Sandberg

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AttributesMapperCallbackHandler(AttributesMapper<T> mapper)` Constructs a new instance around the specified `AttributesMapper`.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `T` | `getObjectFromNameClassPair(NameClassPair nameClassPair)` Cast the NameClassPair to a SearchResult and pass its attributes to the `AttributesMapper`.

    - ### Methods inherited from class org.springframework.ldap.core.CollectingNameClassPairCallbackHandler

      `getList, handleNameClassPair`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### AttributesMapperCallbackHandler

          public AttributesMapperCallbackHandler(AttributesMapper<T> mapper)

      Constructs a new instance around the specified `AttributesMapper`.
      Parameters:
        `mapper` - the target mapper.

  - ### Method Detail

    - #### getObjectFromNameClassPair

          public T getObjectFromNameClassPair(NameClassPair nameClassPair)

      Cast the NameClassPair to a SearchResult and pass its attributes to the `AttributesMapper`.
      Specified by:
        `getObjectFromNameClassPair` in class `CollectingNameClassPairCallbackHandler<T>`
      Parameters:
        `nameClassPair` - a `SearchResult` instance.
      Returns:
        the Object returned from the mapper.