File tree 1 file changed +4
-13
lines changed
api/src/main/java/io/serverlessworkflow/serialization
1 file changed +4
-13
lines changed Original file line number Diff line number Diff line change 16
16
package io .serverlessworkflow .serialization ;
17
17
18
18
import com .fasterxml .jackson .core .JsonGenerator ;
19
+ import io .serverlessworkflow .api .OneOfValueProvider ;
19
20
import java .io .IOException ;
20
- import java .lang .reflect .Method ;
21
21
22
22
public class SerializeHelper {
23
- public static void serializeOneOf (JsonGenerator jgen , Object item ) throws IOException {
24
- try {
25
- for (Method m : item .getClass ().getDeclaredMethods ()) {
26
- Object value = m .invoke (item );
27
- if (value != null ) {
28
- jgen .writeObject (value );
29
- break ;
30
- }
31
- }
32
- } catch (ReflectiveOperationException ex ) {
33
- throw new IOException (ex );
34
- }
23
+ public static void serializeOneOf (JsonGenerator jgen , OneOfValueProvider item )
24
+ throws IOException {
25
+ jgen .writeObject (item .get ());
35
26
}
36
27
}
You can’t perform that action at this time.
0 commit comments