@@ -58,13 +58,23 @@ and Integer uses 2 or 4 bytes).
5858* Serialization of nested Map in a PoJo* : this is done using the GSON library. It is optimized
5959for type matching. Integers are treated as Long numbers.
6060
61- If you want to enforce Integer or Long, please design a PoJo to fit your use case .
61+ If you want to enforce Integer or Long, please PoJo instead of untyped Map .
6262
6363However, floating point numbers (Float and Double) are rendered without type matching.
6464
65- For untyped numbers, you may use the convenient type conversion methods in the platform-core's
65+ For untyped numbers, you may also use the convenient type conversion methods in the platform-core's
6666Utility class. For examples, util.str2int and util.str2long.
6767
68+ Another approach is to use "Number.class" to extract integer or long value to avoid casting error.
69+
70+ for example,
71+ ``` java
72+ if (kv instanceof Number n) {
73+ long v1 = n. longValue();
74+ int v2 = n. intValue();
75+ }
76+ ```
77+
6878## Input using Map or PoJo
6979
7080The input to a TypedLambdaFunction should be a Map or PoJo. A map allows you to use flexible data
@@ -90,7 +100,7 @@ For consistency, we have customized Spring Boot and Servlet serialization and ex
90100
91101## Reactive Design
92102
93- Mercury uses the temporary local file system (` /tmp ` ) as an overflow area for events when the
103+ Mercury uses the temporary local file system (` /tmp/reactive ` ) as an overflow area for events when the
94104consumer is slower than the producer. This event buffering design means that user application
95105does not have to handle back-pressure logic directly.
96106
0 commit comments