File tree Expand file tree Collapse file tree 1 file changed +4
-13
lines changed
api/src/main/java/io/serverlessworkflow/serialization Expand file tree Collapse file tree 1 file changed +4
-13
lines changed Original file line number Diff line number Diff line change 1616package io .serverlessworkflow .serialization ;
1717
1818import com .fasterxml .jackson .core .JsonGenerator ;
19+ import io .serverlessworkflow .api .OneOfValueProvider ;
1920import java .io .IOException ;
20- import java .lang .reflect .Method ;
2121
2222public 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 ());
3526 }
3627}
You can’t perform that action at this time.
0 commit comments