wangmengmeng
2024-12-24 24432a361d5c6bd6f3d8c008693e9f1155d62517
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package com.dji.sdk.cloudapi.map;
 
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import io.swagger.v3.oas.annotations.media.Schema;
 
import java.util.List;
 
/**
 * @author sean
 * @version 0.2
 * @date 2021/11/30
 */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type",
        include = JsonTypeInfo.As.EXISTING_PROPERTY, defaultImpl = ElementGeometryType.class)
@JsonSubTypes({
        @JsonSubTypes.Type(value = ElementCircleGeometry.class, name = "Circle"),
        @JsonSubTypes.Type(value = ElementPointGeometry.class, name = "Point"),
        @JsonSubTypes.Type(value = ElementLineStringGeometry.class, name = "LineString"),
        @JsonSubTypes.Type(value = ElementPolygonGeometry.class, name = "Polygon")
})
@Schema(oneOf = {ElementPointGeometry.class, ElementLineStringGeometry.class, ElementPolygonGeometry.class})
public abstract class ElementGeometryType {
 
    private String type;
 
    ElementGeometryType(String type) {
        this.type = type;
    }
 
    public ElementGeometryType() {
    }
 
    public String getType() {
        return type;
    }
 
    /**
     * Convert coordinate data into objects and then add them to the collection.
     * @return
     */
    public abstract List<ElementCoordinate> convertToList();
 
    /**
     * Converts coordinates in a collection of objects to a specific type.
     * @param coordinateList
     */
    public abstract void adapterCoordinateType(List<ElementCoordinate> coordinateList);
}