public abstract class RelationshipMapper<R extends Relationship> extends Object implements IRelationshipMapper<R>
| Modifier and Type | Field and Description |
|---|---|
protected OMRSAPIHelper |
omrsapiHelper |
protected OMRSRepositoryHelper |
repositoryHelper |
| Constructor and Description |
|---|
RelationshipMapper(OMRSAPIHelper omrsapiHelper) |
| Modifier and Type | Method and Description |
|---|---|
String |
getTypeDefGuid()
get the relationshipTypeDef Guid
This method should be overridden to provide the appropriate guid for the type.
|
abstract String |
getTypeName()
get type name
|
Relationship |
map(R omasRelationship)
Map omasRelationship to the omrs omasRelationship equivalent
|
R |
map(Relationship omrsRelationship)
Map from an OMRS Relationship to a Subject Area OMAS relationship
|
protected boolean |
mapEnumToRelationship(R relationship,
String propertyName,
EnumPropertyValue enumPropertyValue)
Map an omrs enum property to a Subject Area relationship property.
|
protected void |
mapInstancePropertiesToRelationship(R relationship,
InstanceProperties instanceProperties)
Map the instance properties to the relationship
This method should be overridden by subclasses to map the properties to the relationship.
|
protected boolean |
mapMapToRelationship(R omasRelationship,
String propertyName,
InstanceProperties instancePropertyForMap)
Map an omrs map property to a Subject Area relationship property.
|
protected boolean |
mapPrimitiveToRelationship(R relationship,
String propertyName,
Object value)
Map an omrs primitive property to a Subject Area relationship property.
|
protected void |
mapRelationshipToInstanceProperties(R omasRelationship,
InstanceProperties instanceProperties)
Map the supplied relationship to omrs InstanceProperties.
|
protected final OMRSAPIHelper omrsapiHelper
protected final OMRSRepositoryHelper repositoryHelper
public RelationshipMapper(OMRSAPIHelper omrsapiHelper)
public R map(Relationship omrsRelationship)
IRelationshipMappermap in interface IRelationshipMapper<R extends Relationship>map in interface Mapper<Relationship,R extends Relationship>omrsRelationship - OMRS relationshipsprotected void mapInstancePropertiesToRelationship(R relationship, InstanceProperties instanceProperties)
relationship - relationship to be updatedinstanceProperties - properties to use for the updatepublic Relationship map(R omasRelationship)
map in interface IRelationshipMapper<R extends Relationship>map in interface Mapper<Relationship,R extends Relationship>omasRelationship - supplied omasRelationshippublic abstract String getTypeName()
getTypeName in interface Mapper<Relationship,R extends Relationship>public String getTypeDefGuid()
getTypeDefGuid in interface Mapper<Relationship,R extends Relationship>protected boolean mapPrimitiveToRelationship(R relationship, String propertyName, Object value)
relationship - the relationship to be updatedpropertyName - the omrs property namevalue - the omrs primitive property valueprotected boolean mapEnumToRelationship(R relationship, String propertyName, EnumPropertyValue enumPropertyValue)
relationship - the relationship to be updatedpropertyName - the omrs property nameenumPropertyValue - the omrs enum property valueprotected boolean mapMapToRelationship(R omasRelationship, String propertyName, InstanceProperties instancePropertyForMap)
omasRelationship - the relationship to be updatedpropertyName - the omrs property nameinstancePropertyForMap - the omrs map property valueprotected void mapRelationshipToInstanceProperties(R omasRelationship, InstanceProperties instanceProperties)
omasRelationship - supplied relationshipinstanceProperties - equivalent instance properties to the relationshipCopyright © 2018–2021 LF AI & Data Foundation. All rights reserved.