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