Skip to content

Commit

Permalink
LOCAL: Util.java retrofit
Browse files Browse the repository at this point in the history
  • Loading branch information
holmbergius committed Jan 23, 2025
1 parent 354992d commit 9b76064
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions src/main/java/org/ecocean/Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -1152,4 +1152,56 @@ public static String getISO8601Date(final String date) {
if (iso8601.length() == 16) iso8601 += 'Z';
return iso8601;
}

//IOT Customizations
public static List<MeasurementEventDesc> findMeasurementEventDescs(String langCode,String context) {
List<MeasurementEventDesc> list = new ArrayList<MeasurementEventDesc>();
List<String> types = CommonConfiguration.getIndexedPropertyValues(MEASUREMENT,context);
if (types.size() > 0) {
List<String> units = CommonConfiguration.getIndexedPropertyValues(UNITS,context);
for (int i = 0; i < types.size() && i < units.size(); i++) {
String type = types.get(i);
String unit = units.get(i);
String typeLabel = findLabel(type, langCode,context);
String unitsLabel = findLabel(unit, langCode,context);
list.add(new MeasurementEventDesc(type, typeLabel, unit, unitsLabel));
}
}
return list;
}

public static class MeasurementEventDesc {
private String type;
private String label;
private String units;
private String unitsLabel;

private MeasurementEventDesc(String type, String label, String units, String unitsLabel) {
this.type = type;
this.label = label;
this.units = units;
this.unitsLabel = unitsLabel;
}

public String getType() {
return type;
}
public String getLabel() {
return label;
}
public String getUnits() {
return units;
}
public String getUnitsLabel() {
return unitsLabel;
}
}





//END IOT customizations


}

0 comments on commit 9b76064

Please sign in to comment.