ma.glasnost.orika.metadata
Class ClassMap<A,B>
java.lang.Object
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.
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' typebType - the 'B' typefieldsMapping - the specific mapping of the fields from type 'A' to type 'B' and vise-versacustomizedMapper - the customized mapper that should be usedusedMappers - the set of mappers used by this mapper to map ancestors' fieldsconstructorA - 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'
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.