1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.bremersee.geojson.model;
18
19 import com.fasterxml.jackson.annotation.JsonCreator;
20 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
21 import com.fasterxml.jackson.annotation.JsonProperty;
22 import io.swagger.v3.oas.annotations.media.Schema;
23 import java.io.Serial;
24 import java.io.Serializable;
25 import java.math.BigDecimal;
26 import lombok.EqualsAndHashCode;
27 import lombok.Getter;
28 import lombok.ToString;
29
30
31
32
33
34
35 @Schema(description = "WGS84 position with latitude and longitude.")
36 @JsonIgnoreProperties(ignoreUnknown = true)
37 @Getter
38 @EqualsAndHashCode(callSuper = false)
39 @ToString
40 public class LatitudeLongitude implements LatLonAware, Serializable {
41
42 @Serial
43 private static final long serialVersionUID = 1L;
44
45
46
47
48 @Schema(description = "The latitude.")
49 @JsonProperty("latitude")
50 private BigDecimal latitude;
51
52
53
54
55 @Schema(description = "The longitude.")
56 @JsonProperty("longitude")
57 private BigDecimal longitude;
58
59
60
61
62
63
64
65 @JsonCreator
66 public LatitudeLongitude(
67 @JsonProperty("latitude") BigDecimal latitude,
68 @JsonProperty("longitude") BigDecimal longitude) {
69 this.latitude = latitude;
70 this.longitude = longitude;
71 }
72
73
74
75
76
77
78 public LatitudeLongitude(LatLonAware latLonAware) {
79 if (latLonAware != null) {
80 this.latitude = latLonAware.getLatitude();
81 this.longitude = latLonAware.getLongitude();
82 }
83 }
84
85 }