ma.glasnost.orika.metadata
Class ClassMap<A,B>

java.lang.Object
  extended by ma.glasnost.orika.metadata.ClassMap<A,B>
Type Parameters:
A -
B -
All Implemented Interfaces:
MappedTypePair<A,B>

public class ClassMap<A,B>
extends Object
implements MappedTypePair<A,B>

ClassMap represents a mapping association from one type to another.


Constructor Summary
ClassMap(Type<A> aType, Type<B> bType, Set<FieldMap> fieldsMapping, Mapper<A,B> customizedMapper, Set<MapperKey> usedMappers, String[] constructorA, String[] constructorB, Boolean sourcesMappedOnNull, Boolean destinationsMappedOnNull)
          Constructs a new ClassMap
 
Method Summary
 void addFieldMap(FieldMap fieldMap)
           
 Boolean areDestinationsMappedOnNull()
           
 Boolean areSourcesMappedOnNull()
           
 ClassMap<A,B> copy(Set<FieldMap> fieldsMapping)
           
 boolean equals(Object obj)
           
 Type<A> getAType()
           
 String getATypeName()
           
 Type<B> getBType()
           
 String getBTypeName()
           
 String[] getConstructorA()
           
 String[] getConstructorB()
           
 Mapper<A,B> getCustomizedMapper()
           
 Set<FieldMap> getFieldsMapping()
           
 String getMapperClassName()
           
 MapperKey getMapperKey()
           
 Set<MapperKey> getUsedMappers()
           
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ClassMap

public ClassMap(Type<A> aType,
                Type<B> bType,
                Set<FieldMap> fieldsMapping,
                Mapper<A,B> customizedMapper,
                Set<MapperKey> usedMappers,
                String[] constructorA,
                String[] constructorB,
                Boolean sourcesMappedOnNull,
                Boolean destinationsMappedOnNull)
Constructs a new ClassMap

Parameters:
aType - the 'A' type
bType - the 'B' type
fieldsMapping - the specific mapping of the fields from type 'A' to type 'B' and vise-versa
customizedMapper - the customized mapper that should be used
usedMappers - the set of mappers used by this mapper to map ancestors' fields
constructorA - a description of the parameter names of the constructor to use for type 'A'
constructorB - a description of the parameter names of the constructor to use for type 'B'
Method Detail

copy

public ClassMap<A,B> copy(Set<FieldMap> fieldsMapping)

getMapperKey

public MapperKey getMapperKey()

addFieldMap

public void addFieldMap(FieldMap fieldMap)
Parameters:
fieldMap -

getAType

public Type<A> getAType()
Specified by:
getAType in interface MappedTypePair<A,B>
Returns:
the 'A' type for the mapping

getBType

public Type<B> getBType()
Specified by:
getBType in interface MappedTypePair<A,B>
Returns:
the 'B' type for the mapping

getFieldsMapping

public Set<FieldMap> getFieldsMapping()
Returns:
the mapping of fields between the two types of this mapping

getATypeName

public String getATypeName()
Returns:
the name of the 'A' type

getBTypeName

public String getBTypeName()
Returns:
the name of the 'B' type

getCustomizedMapper

public Mapper<A,B> getCustomizedMapper()
Returns:
the customized Mapper to be used for this mapping

getMapperClassName

public String getMapperClassName()
Returns:

getConstructorA

public String[] getConstructorA()
Returns:

getConstructorB

public String[] getConstructorB()
Returns:

areSourcesMappedOnNull

public Boolean areSourcesMappedOnNull()
Returns:
sourcesMappedOnNull for this ClassMap; can be null, which indicates that no preference is specified, and the global default should be used

areDestinationsMappedOnNull

public Boolean areDestinationsMappedOnNull()
Returns:
destinationsMappedOnNull for this ClassMap; can be null, which indicates that no preference is specified, and the global default should be used

hashCode

public int hashCode()
Overrides:
hashCode in class Object

getUsedMappers

public Set<MapperKey> getUsedMappers()

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 2013 Glasnost. All Rights Reserved.