Skip to content

Commit

Permalink
#109 | Cast Measurements into Double values
Browse files Browse the repository at this point in the history
  • Loading branch information
himeshr committed Dec 15, 2023
1 parent 8d8cf32 commit 78eed99
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,15 @@ public class ActivityDTO {
@JsonProperty("OtherVillage")
private String otherVillage;
@JsonProperty("Breadth")
private Long breadth;
private Double breadth;
@JsonProperty("DepthHeight")
private Long depthHeight;
private Double depthHeight;
@JsonProperty("Diameter")
private Long diameter;
private Double diameter;
@JsonProperty("District")
private String district;
@JsonProperty("Length")
private Long length;
private Double length;
@JsonProperty("LocalityVillageName")
private String localityVillageName;
@JsonProperty("tolaMohalla")
Expand Down Expand Up @@ -199,7 +199,7 @@ public ActivityDTO() {
public ActivityDTO(String sourceId, String nameOfAccount, String activityCategory, String activityConductedWithStudents,
String typeOfSchool, String s2sPhotograph, String njpcPhotograph, String activityEndDate,
String activityStartDate, String activitySubType, String activityType, String block, String otherBlock,
String otherVillage, Long breadth, Long depthHeight, Long diameter, String district, Long length,
String otherVillage, Double breadth, Double depthHeight, Double diameter, String district, Double length,
String localityVillageName, String tolaMohalla, String measurementType, Long noofdaysofParticipationNJPC,
Long noofdaysofParticipationS2S, int noofparticipantsFemaleCFW, int noofparticipantsFemaleNJPC,
int noofparticipantsMaleCFW, int noofparticipantsMaleNJPC, int noofparticipantsNJPCOther,
Expand Down Expand Up @@ -392,32 +392,32 @@ public void setOtherVillage(String otherVillage) {
}

@JsonProperty("Breadth")
public Long getBreadth() {
public Double getBreadth() {
return breadth;
}

@JsonProperty("Breadth")
public void setBreadth(Long breadth) {
public void setBreadth(Double breadth) {
this.breadth = breadth;
}

@JsonProperty("DepthHeight")
public Long getDepthHeight() {
public Double getDepthHeight() {
return depthHeight;
}

@JsonProperty("DepthHeight")
public void setDepthHeight(Long depthHeight) {
public void setDepthHeight(Double depthHeight) {
this.depthHeight = depthHeight;
}

@JsonProperty("Diameter")
public Long getDiameter() {
public Double getDiameter() {
return diameter;
}

@JsonProperty("Diameter")
public void setDiameter(Long diameter) {
public void setDiameter(Double diameter) {
this.diameter = diameter;
}

Expand All @@ -432,12 +432,12 @@ public void setDistrict(String district) {
}

@JsonProperty("Length")
public Long getLength() {
public Double getLength() {
return length;
}

@JsonProperty("Length")
public void setLength(Long length) {
public void setLength(Double length) {
this.length = length;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,10 @@ private ActivityDTO createActivityRequest(Subject subject) {
/* Measurement fields */
activityDTO.setMeasurementType((String) subject.getObservation(MEASUREMENTS_TYPE));
activityDTO.setNos((Integer) subject.getObservation(NOS));
activityDTO.setBreadth((subject.getObservation(BREADTH) == null) ? 0L : (Integer) subject.getObservation(BREADTH));
activityDTO.setDiameter((subject.getObservation(DIAMETER) == null) ? 0L : (Integer) subject.getObservation(DIAMETER));
activityDTO.setLength((subject.getObservation(LENGTH) == null) ? 0L : (Integer) subject.getObservation(LENGTH));
activityDTO.setDepthHeight((subject.getObservation(HEIGHT_DEPTH) == null) ? 0L : (Integer) subject.getObservation(HEIGHT_DEPTH));
activityDTO.setBreadth((subject.getObservation(BREADTH) == null) ? 0D : (Double) subject.getObservation(BREADTH));
activityDTO.setDiameter((subject.getObservation(DIAMETER) == null) ? 0D : (Double) subject.getObservation(DIAMETER));
activityDTO.setLength((subject.getObservation(LENGTH) == null) ? 0D : (Double) subject.getObservation(LENGTH));
activityDTO.setDepthHeight((subject.getObservation(HEIGHT_DEPTH) == null) ? 0D : (Double) subject.getObservation(HEIGHT_DEPTH));
/* Photograph fields */
activityDTO.setBeforeImplementationPhotograph(getPhotographStrings(BEFORE_IMPLEMENTATION_PHOTOGRAPH, subject));
activityDTO.setDuringImplementationPhotograph(getPhotographStrings(DURING_IMPLEMENTATION_PHOTOGRAPH, subject));
Expand Down

0 comments on commit 78eed99

Please sign in to comment.