Skip to content

Commit a88b093

Browse files
kvmiloscopybara-github
authored andcommitted
docs: add @deprecated guidance to two deprecated event setters
PiperOrigin-RevId: 990262251
1 parent 9da84d1 commit a88b093

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

‎core/src/main/java/com/google/adk/events/Event.java‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,12 @@ public void setErrorCode(@Nullable FinishReason errorCode) {
172172
this.errorCode = errorCode;
173173
}
174174

175+
/**
176+
* Sets the finish reason from an {@link Optional}.
177+
*
178+
* @deprecated Use {@link #setFinishReason(FinishReason)} with {@code finishReason.orElse(null)}
179+
* instead.
180+
*/
175181
@Deprecated
176182
@SuppressWarnings("checkstyle:IllegalType")
177183
public void setFinishReason(Optional<FinishReason> finishReason) {

‎core/src/main/java/com/google/adk/events/EventActions.java‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,13 @@ public Map<String, Object> stateDelta() {
9292
return stateDelta;
9393
}
9494

95-
@Deprecated // Use stateDelta() and removeStateByKey() instead.
95+
/**
96+
* Replaces the state delta.
97+
*
98+
* @deprecated Update the map returned by {@link #stateDelta()} instead, and use {@link
99+
* #removeStateByKey(String)} to remove a key.
100+
*/
101+
@Deprecated
96102
public void setStateDelta(ConcurrentMap<String, Object> stateDelta) {
97103
this.stateDelta = stateDelta;
98104
}

0 commit comments

Comments
 (0)