11package io .a2a .extras .queuemanager .replicated .core ;
22
3- import com .fasterxml .jackson .annotation .JsonGetter ;
4- import com .fasterxml .jackson .annotation .JsonIgnore ;
5- import com .fasterxml .jackson .annotation .JsonInclude ;
6- import com .fasterxml .jackson .annotation .JsonSetter ;
7-
83import io .a2a .server .events .EventQueueItem ;
94import io .a2a .spec .Event ;
105import io .a2a .spec .JSONRPCError ;
116import io .a2a .spec .StreamingEventKind ;
127
138public class ReplicatedEventQueueItem implements EventQueueItem {
149 private String taskId ;
15-
16- @ JsonInclude (JsonInclude .Include .NON_NULL )
1710 private StreamingEventKind event ;
18-
19- @ JsonInclude (JsonInclude .Include .NON_NULL )
2011 private JSONRPCError error ;
2112
2213 private boolean closedEvent ;
@@ -72,13 +63,10 @@ public void setTaskId(String taskId) {
7263 * Get the StreamingEventKind event field (for JSON serialization).
7364 * @return the StreamingEventKind event or null
7465 */
75- @ JsonGetter ("event" )
76- @ JsonInclude (JsonInclude .Include .NON_NULL )
7766 public StreamingEventKind getStreamingEvent () {
7867 return event ;
7968 }
8069
81- @ JsonSetter ("event" )
8270 public void setEvent (StreamingEventKind event ) {
8371 this .event = event ;
8472 this .error = null ; // Clear error when setting event
@@ -88,13 +76,10 @@ public void setEvent(StreamingEventKind event) {
8876 * Get the JSONRPCError field (for JSON serialization).
8977 * @return the JSONRPCError or null
9078 */
91- @ JsonGetter ("error" )
92- @ JsonInclude (JsonInclude .Include .NON_NULL )
9379 public JSONRPCError getErrorObject () {
9480 return error ;
9581 }
9682
97- @ JsonSetter ("error" )
9883 public void setError (JSONRPCError error ) {
9984 this .error = error ;
10085 this .event = null ; // Clear event when setting error
@@ -105,7 +90,6 @@ public void setError(JSONRPCError error) {
10590 * This is the method required by the EventQueueItem interface.
10691 * @return the event (StreamingEventKind, JSONRPCError, or QueueClosedEvent) or null if none is set
10792 */
108- @ JsonIgnore
10993 @ Override
11094 public Event getEvent () {
11195 if (closedEvent ) {
@@ -121,7 +105,6 @@ public Event getEvent() {
121105 * Indicates this is a replicated event (implements EventQueueItem).
122106 * @return always true for replicated events
123107 */
124- @ JsonIgnore
125108 @ Override
126109 public boolean isReplicated () {
127110 return true ;
@@ -148,7 +131,6 @@ public boolean hasError() {
148131 * For JSON serialization.
149132 * @return true if this is a queue closed event
150133 */
151- @ JsonGetter ("closedEvent" )
152134 public boolean isClosedEvent () {
153135 return closedEvent ;
154136 }
@@ -157,7 +139,6 @@ public boolean isClosedEvent() {
157139 * Set the closed event flag (for JSON deserialization).
158140 * @param closedEvent true if this is a queue closed event
159141 */
160- @ JsonSetter ("closedEvent" )
161142 public void setClosedEvent (boolean closedEvent ) {
162143 this .closedEvent = closedEvent ;
163144 if (closedEvent ) {
0 commit comments