it.avutils.jmapper
Interface IJMapper<D,S>

Type Parameters:
D - Type of the Destination Class
S - Type of Source Class
All Known Implementing Classes:
JMapper

public interface IJMapper<D,S>

JMapper takes as input two classes, Destination and Source.
For Destination, we mean the instance that will be created or enhanced.
For Source, we mean the instance containing the data.
To execute the mapping, we must before configure one class beetween Destination and Source.

for example:


 class Destination {
 
  @JMap
  String id;
 
  @JMap("sourceField")
  String destinationField;
  
  String other;
  
  // getter and setter
 }
 
 class Source {
 
  String id;
 
  String sourceField;
  
  String other;
  
  // getter and setter
 }
 
then invoke the method GetDestination.

For example:
    
 Source source = new Source("id", "sourceField", "other");
 JMapper jmapper = new JMapper(Destination.class, Source.class);
 // new instance
 Destination destination = jmapper.getDestination(source); 
 // enrichment
 jmapper.getDestination(destination, source);

Author:
Alessandro Vurro

Method Summary
 D getDestination(D destination, S source)
          This Method returns the destination given in input enriched with data contained in source given in input
with this setting: NullPointerControlALL MappingType of DestinationALL_FIELDS MappingType of SourceALL_FIELDS
 D getDestination(D destination, S source, MappingType mtDestination, MappingType mtSource)
          This Method returns the destination given in input enriched with data contained in source given in input
with this setting: NullPointerControlALL MappingType of DestinationmtDestination MappingType of SourcemtSource
 D getDestination(D destination, S source, NullPointerControl nullPointerControl, MappingType mtDestination, MappingType mtSource)
          This Method returns the destination given in input enriched with data contained in source given in input
with this setting: NullPointerControlnullPointerControl MappingType of DestinationmtDestination MappingType of SourcemtSource
 D getDestination(S source)
          This method returns a new instance of Destination Class with this setting: NullPointerControlSOURCE MappingType of DestinationALL_FIELDS MappingType of SourceALL_FIELDS
 D getDestination(S source, MappingType mtSource)
          This method returns a new instance of Destination Class with this setting: NullPointerControlSOURCE MappingType of DestinationALL_FIELDS MappingType of SourcemtSource
 D getDestination(S source, NullPointerControl nullPointerControl, MappingType mtSource)
          This method returns a new instance of Destination Class with this setting: NullPointerControlnullPointerControl MappingType of DestinationALL_FIELDS MappingType of SourcemtSource
 D getDestinationWithoutControl(D destination, S source)
          This Method returns the destination given in input enriched with data contained in source given in input
with this setting: NullPointerControlNOT_ANY MappingType of DestinationALL_FIELDS MappingType of SourceALL_FIELDS
 D getDestinationWithoutControl(S source)
          This method returns a new instance of Destination Class with this setting: NullPointerControlNOT_ANY MappingType of DestinationALL_FIELDS MappingType of SourceALL_FIELDS
 

Method Detail

getDestination

D getDestination(S source)
This method returns a new instance of Destination Class with this setting:
NullPointerControlSOURCE
MappingType of DestinationALL_FIELDS
MappingType of SourceALL_FIELDS

Parameters:
source - instance that contains the data
Returns:
new instance of destination
See Also:
NullPointerControl, MappingType

getDestinationWithoutControl

D getDestinationWithoutControl(S source)
This method returns a new instance of Destination Class with this setting:
NullPointerControlNOT_ANY
MappingType of DestinationALL_FIELDS
MappingType of SourceALL_FIELDS

Parameters:
source - instance that contains the data
Returns:
new instance of destination
See Also:
NullPointerControl, MappingType

getDestination

D getDestination(D destination,
                 S source)
This Method returns the destination given in input enriched with data contained in source given in input
with this setting:
NullPointerControlALL
MappingType of DestinationALL_FIELDS
MappingType of SourceALL_FIELDS

Parameters:
destination - instance to enrich
source - instance that contains the data
Returns:
destination enriched
See Also:
NullPointerControl, MappingType

getDestinationWithoutControl

D getDestinationWithoutControl(D destination,
                               S source)
This Method returns the destination given in input enriched with data contained in source given in input
with this setting:
NullPointerControlNOT_ANY
MappingType of DestinationALL_FIELDS
MappingType of SourceALL_FIELDS

Parameters:
destination - instance to enrich
source - instance that contains the data
Returns:
destination enriched
See Also:
NullPointerControl, MappingType

getDestination

D getDestination(S source,
                 MappingType mtSource)
This method returns a new instance of Destination Class with this setting:
NullPointerControlSOURCE
MappingType of DestinationALL_FIELDS
MappingType of SourcemtSource

Parameters:
source - instance that contains the data
mtSource - type of mapping
Returns:
new instance of destination
See Also:
NullPointerControl, MappingType

getDestination

D getDestination(S source,
                 NullPointerControl nullPointerControl,
                 MappingType mtSource)
This method returns a new instance of Destination Class with this setting:
NullPointerControlnullPointerControl
MappingType of DestinationALL_FIELDS
MappingType of SourcemtSource

Parameters:
source - instance that contains the data
nullPointerControl - type of control
mtSource - type of mapping
Returns:
new instance of destination
See Also:
NullPointerControl, MappingType

getDestination

D getDestination(D destination,
                 S source,
                 MappingType mtDestination,
                 MappingType mtSource)
This Method returns the destination given in input enriched with data contained in source given in input
with this setting:
NullPointerControlALL
MappingType of DestinationmtDestination
MappingType of SourcemtSource

Parameters:
destination - instance to enrich
source - instance that contains the data
mtDestination - type of mapping of destination instance
mtSource - type of mapping of source instance
Returns:
destination enriched
See Also:
NullPointerControl, MappingType

getDestination

D getDestination(D destination,
                 S source,
                 NullPointerControl nullPointerControl,
                 MappingType mtDestination,
                 MappingType mtSource)
This Method returns the destination given in input enriched with data contained in source given in input
with this setting:
NullPointerControlnullPointerControl
MappingType of DestinationmtDestination
MappingType of SourcemtSource

Parameters:
destination - instance to enrich
source - instance that contains the data
nullPointerControl - type of control
mtDestination - type of mapping of destination instance
mtSource - type of mapping of source instance
Returns:
destination enriched
See Also:
NullPointerControl, MappingType


Copyright © 2013. All Rights Reserved.