2 * Copyright (C) 2021 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
9 package eu
.etaxonomy
.cdm
.api
.service
.dto
;
11 import java
.util
.UUID
;
13 import eu
.etaxonomy
.cdm
.model
.common
.Annotation
;
14 import eu
.etaxonomy
.cdm
.model
.common
.CdmBase
;
15 import eu
.etaxonomy
.cdm
.ref
.TypedEntityReference
;
18 * @author a.kohlbecker
21 public class AnnotationDTO
extends TypedEntityReference
<Annotation
> {
23 private static final long serialVersionUID
= 4865632821417238523L;
25 private UUID annotationTypeUuid
= null;
26 private String text
= null;
28 public static <T
extends CdmBase
> AnnotationDTO
fromEntity(Annotation annotation
) {
29 AnnotationDTO dto
= new AnnotationDTO(Annotation
.class, annotation
.getUuid());
30 if(annotation
.getAnnotationType() != null) {
31 dto
.setAnnotationTypeUuid(annotation
.getAnnotationType().getUuid());
33 dto
.setText(annotation
.getText());
37 @SuppressWarnings("deprecation")
38 public AnnotationDTO(Class
<Annotation
> type
, UUID uuid
) {
43 public UUID
getAnnotationTypeUuid() {
44 return annotationTypeUuid
;
47 private void setAnnotationTypeUuid(UUID annotationTypeUuid
) {
48 this.annotationTypeUuid
= annotationTypeUuid
;
51 public String
getText() {
55 private void setText(String text
) {