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 ;
73import io .a2a .server .events .EventQueueItem ;
84import io .a2a .spec .A2AError ;
95import io .a2a .spec .Event ;
128public class ReplicatedEventQueueItem implements EventQueueItem {
139 private String taskId ;
1410
15- @ JsonInclude (JsonInclude .Include .NON_NULL )
1611 private StreamingEventKind event ;
1712
18- @ JsonInclude (JsonInclude .Include .NON_NULL )
1913 private A2AError error ;
2014
2115 private boolean closedEvent ;
@@ -71,13 +65,10 @@ public void setTaskId(String taskId) {
7165 * Get the StreamingEventKind event field (for JSON serialization).
7266 * @return the StreamingEventKind event or null
7367 */
74- @ JsonGetter ("event" )
75- @ JsonInclude (JsonInclude .Include .NON_NULL )
7668 public StreamingEventKind getStreamingEvent () {
7769 return event ;
7870 }
7971
80- @ JsonSetter ("event" )
8172 public void setEvent (StreamingEventKind event ) {
8273 this .event = event ;
8374 this .error = null ; // Clear error when setting event
@@ -87,13 +78,10 @@ public void setEvent(StreamingEventKind event) {
8778 * Get the A2AError field (for JSON serialization).
8879 * @return the A2AError or null
8980 */
90- @ JsonGetter ("error" )
91- @ JsonInclude (JsonInclude .Include .NON_NULL )
9281 public A2AError getErrorObject () {
9382 return error ;
9483 }
9584
96- @ JsonSetter ("error" )
9785 public void setError (A2AError error ) {
9886 this .error = error ;
9987 this .event = null ; // Clear event when setting error
@@ -104,7 +92,6 @@ public void setError(A2AError error) {
10492 * This is the method required by the EventQueueItem interface.
10593 * @return the event (StreamingEventKind, A2AError, or QueueClosedEvent) or null if none is set
10694 */
107- @ JsonIgnore
10895 @ Override
10996 public Event getEvent () {
11097 if (closedEvent ) {
@@ -120,7 +107,6 @@ public Event getEvent() {
120107 * Indicates this is a replicated event (implements EventQueueItem).
121108 * @return always true for replicated events
122109 */
123- @ JsonIgnore
124110 @ Override
125111 public boolean isReplicated () {
126112 return true ;
@@ -147,7 +133,6 @@ public boolean hasError() {
147133 * For JSON serialization.
148134 * @return true if this is a queue closed event
149135 */
150- @ JsonGetter ("closedEvent" )
151136 public boolean isClosedEvent () {
152137 return closedEvent ;
153138 }
@@ -156,7 +141,6 @@ public boolean isClosedEvent() {
156141 * Set the closed event flag (for JSON deserialization).
157142 * @param closedEvent true if this is a queue closed event
158143 */
159- @ JsonSetter ("closedEvent" )
160144 public void setClosedEvent (boolean closedEvent ) {
161145 this .closedEvent = closedEvent ;
162146 if (closedEvent ) {
0 commit comments