Skip to content

Commit

Permalink
fix (Conversation/Coordinates): Use 'Double' in place of 'Float' to s…
Browse files Browse the repository at this point in the history
…tore coordinates
  • Loading branch information
JPPortier committed Aug 29, 2024
1 parent a1d380d commit 759e43a
Show file tree
Hide file tree
Showing 42 changed files with 118 additions and 118 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ public interface Coordinates {
*
* @return latitude
*/
Float getLatitude();
Double getLatitude();

/**
* The longitude.
*
* @return longitude
*/
Float getLongitude();
Double getLongitude();

/**
* Getting builder
Expand All @@ -49,7 +49,7 @@ interface Builder {
* @return Current builder
* @see #getLatitude
*/
Builder setLatitude(Float latitude);
Builder setLatitude(Double latitude);

/**
* see getter
Expand All @@ -58,7 +58,7 @@ interface Builder {
* @return Current builder
* @see #getLongitude
*/
Builder setLongitude(Float longitude);
Builder setLongitude(Double longitude);

/**
* Create instance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,38 +20,38 @@ public class CoordinatesImpl implements Coordinates {

public static final String JSON_PROPERTY_LATITUDE = "latitude";

private OptionalValue<Float> latitude;
private OptionalValue<Double> latitude;

public static final String JSON_PROPERTY_LONGITUDE = "longitude";

private OptionalValue<Float> longitude;
private OptionalValue<Double> longitude;

public CoordinatesImpl() {}

protected CoordinatesImpl(OptionalValue<Float> latitude, OptionalValue<Float> longitude) {
protected CoordinatesImpl(OptionalValue<Double> latitude, OptionalValue<Double> longitude) {
this.latitude = latitude;
this.longitude = longitude;
}

@JsonIgnore
public Float getLatitude() {
public Double getLatitude() {
return latitude.orElse(null);
}

@JsonProperty(JSON_PROPERTY_LATITUDE)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public OptionalValue<Float> latitude() {
public OptionalValue<Double> latitude() {
return latitude;
}

@JsonIgnore
public Float getLongitude() {
public Double getLongitude() {
return longitude.orElse(null);
}

@JsonProperty(JSON_PROPERTY_LONGITUDE)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public OptionalValue<Float> longitude() {
public OptionalValue<Double> longitude() {
return longitude;
}

Expand Down Expand Up @@ -96,17 +96,17 @@ private String toIndentedString(Object o) {

@JsonPOJOBuilder(withPrefix = "set")
static class Builder implements Coordinates.Builder {
OptionalValue<Float> latitude = OptionalValue.empty();
OptionalValue<Float> longitude = OptionalValue.empty();
OptionalValue<Double> latitude = OptionalValue.empty();
OptionalValue<Double> longitude = OptionalValue.empty();

@JsonProperty(JSON_PROPERTY_LATITUDE)
public Builder setLatitude(Float latitude) {
public Builder setLatitude(Double latitude) {
this.latitude = OptionalValue.of(latitude);
return this;
}

@JsonProperty(JSON_PROPERTY_LONGITUDE)
public Builder setLongitude(Float longitude) {
public Builder setLongitude(Double longitude) {
this.longitude = OptionalValue.of(longitude);
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
public class CoordinatesDtoTest extends ConversationBaseTest {

public static Coordinates coordinatesDto =
Coordinates.builder().setLatitude(47.627980F).setLongitude(-2.822915F).build();
Coordinates.builder().setLatitude(47.6279809).setLongitude(-2.8229159).build();

@GivenTextResource("/domains/conversation/v1/messages/types/location/CoordinatesDto.json")
String jsonCoordinatesDto;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class LocationMessageDtoTest extends ConversationBaseTest {
public static LocationMessage locationMessageDto =
LocationMessage.builder()
.setCoordinates(
Coordinates.builder().setLatitude(47.627980F).setLongitude(-2.822915F).build())
Coordinates.builder().setLatitude(47.6279809).setLongitude(-2.8229159).build())
.setTitle("title value")
.setLabel("label value")
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
{
"location_message": {
"coordinates": {
"latitude": 47.62798,
"longitude": -2.822915
"latitude": 47.6279809,
"longitude": -2.8229159
},
"label": "label value",
"title": "title value"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
"contact_message": {
"location_message": {
"coordinates": {
"latitude": 47.627980,
"longitude": -2.822915
"latitude": 47.6279809,
"longitude": -2.8229159
},
"title": "title value",
"label": "label value"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"contact_message": {
"location_message": {
"coordinates": {
"latitude": 47.627980,
"longitude": -2.822915
"latitude": 47.6279809,
"longitude": -2.8229159
},
"title": "title value",
"label": "label value"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"contact_message": {
"location_message": {
"coordinates": {
"latitude": 47.627980,
"longitude": -2.822915
"latitude": 47.6279809,
"longitude": -2.8229159
},
"title": "title value",
"label": "label value"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
{
"location_message": {
"coordinates": {
"latitude": 47.627980,
"longitude": -2.822915
"latitude": 47.6279809,
"longitude": -2.8229159
},
"title": "title value",
"label": "label value"
Expand Down Expand Up @@ -60,8 +60,8 @@
{
"location_message": {
"coordinates": {
"latitude": 47.627980,
"longitude": -2.822915
"latitude": 47.6279809,
"longitude": -2.8229159
},
"title": "title value",
"label": "label value"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
{
"location_message": {
"coordinates": {
"latitude": 47.627980,
"longitude": -2.822915
"latitude": 47.6279809,
"longitude": -2.8229159
},
"title": "title value",
"label": "label value"
Expand Down Expand Up @@ -54,8 +54,8 @@
{
"location_message": {
"coordinates": {
"latitude": 47.627980,
"longitude": -2.822915
"latitude": 47.6279809,
"longitude": -2.8229159
},
"title": "title value",
"label": "label value"
Expand Down Expand Up @@ -98,8 +98,8 @@
{
"location_message": {
"coordinates": {
"latitude": 47.627980,
"longitude": -2.822915
"latitude": 47.6279809,
"longitude": -2.8229159
},
"title": "title value",
"label": "label value"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
{
"location_message": {
"coordinates": {
"latitude": 47.627980,
"longitude": -2.822915
"latitude": 47.6279809,
"longitude": -2.8229159
},
"title": "title value",
"label": "label value"
Expand Down Expand Up @@ -58,8 +58,8 @@
{
"location_message": {
"coordinates": {
"latitude": 47.627980,
"longitude": -2.822915
"latitude": 47.6279809,
"longitude": -2.8229159
},
"title": "title value",
"label": "label value"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@
{
"location_message": {
"coordinates": {
"latitude": 47.627980,
"longitude": -2.822915
"latitude": 47.6279809,
"longitude": -2.8229159
},
"title": "title value",
"label": "label value"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
{
"location_message": {
"coordinates": {
"latitude": 47.627980,
"longitude": -2.822915
"latitude": 47.6279809,
"longitude": -2.8229159
},
"title": "title value",
"label": "label value"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"location_message": {
"coordinates": {
"latitude": 47.62798,
"longitude": -2.822915
"latitude": 47.6279809,
"longitude": -2.8229159
},
"label": "label value",
"title": "title value"
Expand All @@ -24,8 +24,8 @@
{
"location_message": {
"coordinates": {
"latitude": 47.62798,
"longitude": -2.822915
"latitude": 47.6279809,
"longitude": -2.8229159
},
"label": "label value",
"title": "title value"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
{
"location_message": {
"coordinates": {
"latitude": 47.627980,
"longitude": -2.822915
"latitude": 47.6279809,
"longitude": -2.8229159
},
"title": "title value",
"label": "label value"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
{
"location_message": {
"coordinates": {
"latitude": 47.627980,
"longitude": -2.822915
"latitude": 47.6279809,
"longitude": -2.8229159
},
"title": "title value",
"label": "label value"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
{
"location_message": {
"coordinates": {
"latitude": 47.627980,
"longitude": -2.822915
"latitude": 47.6279809,
"longitude": -2.8229159
},
"title": "title value",
"label": "label value"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"location_message": {
"coordinates": {
"latitude": 47.62798,
"longitude": -2.822915
"latitude": 47.6279809,
"longitude": -2.8229159
},
"label": "label value",
"title": "title value"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
{
"location_message": {
"coordinates": {
"latitude": 47.627980,
"longitude": -2.822915
"latitude": 47.6279809,
"longitude": -2.8229159
},
"title": "title value",
"label": "label value"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"contact_message": {
"location_message": {
"coordinates": {
"latitude": 47.627980,
"longitude": -2.822915
"latitude": 47.6279809,
"longitude": -2.8229159
},
"title": "title value",
"label": "label value"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
{
"location_message": {
"coordinates": {
"latitude": 47.627980,
"longitude": -2.822915
"latitude": 47.6279809,
"longitude": -2.8229159
},
"title": "title value",
"label": "label value"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
{
"location_message": {
"coordinates": {
"latitude": 47.627980,
"longitude": -2.822915
"latitude": 47.6279809,
"longitude": -2.8229159
},
"title": "title value",
"label": "label value"
Expand Down Expand Up @@ -54,8 +54,8 @@
{
"location_message": {
"coordinates": {
"latitude": 47.627980,
"longitude": -2.822915
"latitude": 47.6279809,
"longitude": -2.8229159
},
"title": "title value",
"label": "label value"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
{
"location_message": {
"coordinates": {
"latitude": 47.627980,
"longitude": -2.822915
"latitude": 47.6279809,
"longitude": -2.8229159
},
"title": "title value",
"label": "label value"
Expand Down
Loading

0 comments on commit 759e43a

Please sign in to comment.