Project

General

Profile

Revision 3a646557

ID3a6465577d443f6dd0f7da29e85933353a9c228f
Parent 912932b1
Child 50355d23

Added by Andreas Müller about 5 years ago

further refactor FindByIdentifierDTO and FindByMarkerDTO

View differences:

cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/dto/EntityDTOBase.java
12 12
import java.util.UUID;
13 13

  
14 14
import eu.etaxonomy.cdm.model.common.CdmBase;
15
import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
15 16

  
16 17

  
17 18
/**
......
38 39

  
39 40
    protected CdmEntity cdmEntity;
40 41

  
42
    public EntityDTOBase(IdentifiableEntity entity){
43
        this.cdmEntity = new CdmEntity(entity.getUuid(), entity.getTitleCache(), (T)entity);
44
    }
45

  
46
    public EntityDTOBase(UUID entityUuid, String label){
47
        this.cdmEntity = new CdmEntity(entityUuid, label, null);
48
    }
49

  
41 50
    public CdmEntity getCdmEntity() {
42 51
        return cdmEntity;
43 52
    }
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/dto/IdentifiedEntityDTO.java
39 39

  
40 40

  
41 41
	public IdentifiedEntityDTO(DefinedTerm identifierType, String identifier, T entity){
42
		this.identifier = new AlternativeIdentifier(identifierType, identifier);
43
		this.cdmEntity = new CdmEntity(entity.getUuid(), entity.getTitleCache(), entity);
42
	    super(entity);
43
	    this.identifier = new AlternativeIdentifier(identifierType, identifier);
44 44
	}
45 45

  
46 46
	public IdentifiedEntityDTO(DefinedTerm identifierType, String identifier, UUID entityUuid, String titleCache){
47
		this.identifier = new AlternativeIdentifier(identifierType, identifier);
48
		this.cdmEntity = new CdmEntity(entityUuid, null, null);
47
	    super(entityUuid, titleCache);
48
	    this.identifier = new AlternativeIdentifier(identifierType, identifier);
49 49
	}
50 50

  
51 51
	public AlternativeIdentifier getIdentifier() {
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/dto/MarkedEntityDTO.java
41 41
	private Marker marker;
42 42

  
43 43
	public MarkedEntityDTO(MarkerType markerType, Boolean flag, T entity){
44
	    super(entity);
44 45
		this.marker = new Marker(markerType, flag);
45
		this.cdmEntity = new CdmEntity(entity.getUuid(), entity.getTitleCache(), entity);
46 46
	}
47 47

  
48 48
	public MarkedEntityDTO(MarkerType markerType, Boolean flag, UUID entityUuid, String titleCache){
49
		this.marker = new Marker(markerType, flag);
50
		this.cdmEntity = new CdmEntity(entityUuid, titleCache, null);
49
	    super(entityUuid, titleCache);
50
	    this.marker = new Marker(markerType, flag);
51 51
	}
52 52

  
53 53
	public Marker getMarker() {

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)