Announcement Announcement Module
Collapse
No announcement yet.
AbstractContextMapper class and ParameterizedContextMapper interface Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • AbstractContextMapper class and ParameterizedContextMapper interface

    These two items seem to be at cross purposes. AbstractContextMapper has subclasses implement

    Code:
    protected abstract Object doMapFromContext(DirContextOperations ctx)
    The mapFromContext method is final, and returns Object.

    The ParameterizedContextMapper<T> interface includes

    Code:
    T mapFromContext(Object ctx)
    One cannot mix these two; the following declaration does not compile:

    Code:
    public class PersonContextMapper extends AbstractContextMapper
        implements ParameterizedContextMapper<Person>

    Would it be possible to combine the ideas of these two items? Could there be a ParameterizedAbstractContextMapper<T>:

    Code:
    public abstract class ParameterizedAbstractContextMapper<T>
        implements ParameterizedContextMapper<T> {
        public final T mapFromContext(Object obj) {
            return doMapFromContext((DirContextOperations) obj);
        }
        protected abstract T doMapFromContext(DirContextOperations ctx);
    }

  • #2
    I think you're looiking for AbstractParameterizedContextMapper<T>, right?

    Comment


    • #3
      Ashamed of myself

      I apologize. I really should look harder at the Javadoc. Darn!

      Comment

      Working...
      X