Interface MappingContext<S,D>


public interface MappingContext<S,D>
Maintains context during the mapping of a source object of type S to a destination object of type D.
  • Method Summary

    Modifier and Type
    Method
    Description
    <CS, CD> MappingContext<CS,CD>
    create(CS source, CD destination)
    Creates a new child MappingContext for the source and destination which inherits all other information from this MappingContext.
    <CS, CD> MappingContext<CS,CD>
    create(CS source, Class<CD> destinationType)
    Creates a new child MappingContext for the source and destinationType which inherits all other information from this MappingContext.
    <CS, CD> MappingContext<CS,CD>
    create(CS source, Type destinationType)
    Creates a new child MappingContext for the source and destinationType which inherits all other information from this MappingContext.
    Returns the destination object being mapped to or null if the destination has not yet been initialized.
    Returns the destination type being mapped to.
    Returns the generic destination type.
    Returns the mapping associated with the mapping request else null if the request did not originate from a TypeMap.
    Returns the MappingEngine that initiated the mapping request.
    Returns the parent MappingContext from which the current MappingContext was created, else null if there is no parent context.
    Returns the source object being mapped from.
    Returns the source type being mapped from.
    Returns the TypeMap associated with the mapping request else null if the request did not originate from a TypeMap.
    Returns the name of the TypeMap associated with the mapping request else null if the request did not originate from a named TypeMap.
  • Method Details

    • create

      <CS, CD> MappingContext<CS,CD> create(CS source, CD destination)
      Creates a new child MappingContext for the source and destination which inherits all other information from this MappingContext.
      Type Parameters:
      CS - child source type
      CD - child destination type
      Parameters:
      source - to map from
      destination - to map to
      Returns:
      new child MappingContext
      Throws:
      IllegalArgumentException - if source or destination are null
    • create

      <CS, CD> MappingContext<CS,CD> create(CS source, Class<CD> destinationType)
      Creates a new child MappingContext for the source and destinationType which inherits all other information from this MappingContext.
      Type Parameters:
      CS - child source type
      CD - child destination type
      Parameters:
      source - to map from
      destinationType - to map to
      Returns:
      new child MappingContext
      Throws:
      IllegalArgumentException - if source or destinationType are null
    • create

      <CS, CD> MappingContext<CS,CD> create(CS source, Type destinationType)
      Creates a new child MappingContext for the source and destinationType which inherits all other information from this MappingContext.
      Type Parameters:
      CS - child source type
      CD - child destination type
      Parameters:
      source - to map from
      destinationType - to map to
      Returns:
      new child MappingContext
      Throws:
      IllegalArgumentException - if source or destinationType are null
    • getDestination

      D getDestination()
      Returns the destination object being mapped to or null if the destination has not yet been initialized.
    • getDestinationType

      Class<D> getDestinationType()
      Returns the destination type being mapped to.
    • getGenericDestinationType

      Type getGenericDestinationType()
      Returns the generic destination type.
    • getMapping

      Mapping getMapping()
      Returns the mapping associated with the mapping request else null if the request did not originate from a TypeMap.
    • getMappingEngine

      MappingEngine getMappingEngine()
      Returns the MappingEngine that initiated the mapping request.
    • getParent

      MappingContext<?,?> getParent()
      Returns the parent MappingContext from which the current MappingContext was created, else null if there is no parent context.
    • getSource

      S getSource()
      Returns the source object being mapped from.
    • getSourceType

      Class<S> getSourceType()
      Returns the source type being mapped from.
    • getTypeMap

      TypeMap<S,D> getTypeMap()
      Returns the TypeMap associated with the mapping request else null if the request did not originate from a TypeMap.
    • getTypeMapName

      String getTypeMapName()
      Returns the name of the TypeMap associated with the mapping request else null if the request did not originate from a named TypeMap.