}
public static Annotation convert(org.openbel.framework.common.model.Annotation annotation) {
if (annotation == null) return null;
Annotation wsAnnotation = OBJECT_FACTORY.createAnnotation();
AnnotationType wsAnnotationType = OBJECT_FACTORY.createAnnotationType();
AnnotationDefinition def = annotation.getDefinition();
if (def.getId() != null) wsAnnotationType.setName(def.getId());
if (def.getDescription() != null) wsAnnotationType.setDescription(def.getDescription());
if (def.getUsage() != null) wsAnnotationType.setUsage(def.getUsage());
if (def.getType() != null) {
AnnotationDefinitionType ad = AnnotationDefinitionType.fromValue(def.getType().toString());
wsAnnotationType.setAnnotationDefinitionType(ad);
}
wsAnnotation.setAnnotationType(wsAnnotationType);
wsAnnotation.setValue(annotation.getValue());
return wsAnnotation;
}