Skip to content

Commit

Permalink
Add support for double values in HopMetadataProperty, fixes apache#4469
Browse files Browse the repository at this point in the history
  • Loading branch information
hansva committed Oct 23, 2024
1 parent 1ca516d commit 4ed955a
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ private static String serializeObjectToXml(
}
} else if (value instanceof Long longValue) {
xml += XmlHandler.addTagValue(tag, longValue);
} else if (value instanceof Double doubleValue) {
xml += XmlHandler.addTagValue(tag, doubleValue);
} else if (value instanceof Date date) {
xml += XmlHandler.addTagValue(tag, date);
} else if (value.getClass().isEnum()) {
Expand Down Expand Up @@ -481,6 +483,10 @@ private static Object deSerializeFromXml(
if (elementNode != null) {
return Long.valueOf(elementString);
}
} else if (fieldType.equals(double.class) || fieldType.equals(Double.class)) {
if (elementNode != null) {
return Double.valueOf(elementString);
}
} else if (fieldType.equals(Date.class)) {
if (elementNode != null) {
return XmlHandler.stringToDate(elementString);
Expand Down

0 comments on commit 4ed955a

Please sign in to comment.