*
* @param exposed the 2004/08 Relationship
* @return an equivalent 2005/08 RelatesToType
*/
public static RelatesToType convert(Relationship exposed) {
RelatesToType internal = null;
if (exposed != null) {
internal = ContextUtils.WSA_OBJECT_FACTORY.createRelatesToType();
internal.setValue(exposed.getValue());
QName exposedRelationshipType = exposed.getRelationshipType();
if (exposedRelationshipType != null) {
String internalRelationshipType =
Names.WSA_REPLY_NAME.equals(
exposedRelationshipType.getLocalPart())
? Names.WSA_RELATIONSHIP_REPLY
: exposedRelationshipType.toString();
internal.setRelationshipType(internalRelationshipType);
}
internal.getOtherAttributes().putAll(exposed.getOtherAttributes());
}
return internal;
}