|
1 | 1 | package io.a2a.spec; |
2 | 2 |
|
3 | 3 | import io.a2a.util.Assert; |
| 4 | +import io.a2a.util.Utils; |
| 5 | +import org.jspecify.annotations.Nullable; |
4 | 6 |
|
5 | 7 | /** |
6 | 8 | * Parameters for listing all push notification configurations for a task. |
@@ -51,4 +53,88 @@ public int getEffectivePageSize() { |
51 | 53 | } |
52 | 54 | return pageSize; |
53 | 55 | } |
| 56 | + |
| 57 | + /** |
| 58 | + * Create a new Builder |
| 59 | + * |
| 60 | + * @return the builder |
| 61 | + */ |
| 62 | + public static Builder builder() { |
| 63 | + return new Builder(); |
| 64 | + } |
| 65 | + |
| 66 | + /** |
| 67 | + * Builder for constructing instances. |
| 68 | + */ |
| 69 | + public static class Builder { |
| 70 | + private @Nullable String id; |
| 71 | + private @Nullable Integer pageSize; |
| 72 | + private @Nullable String pageToken; |
| 73 | + private @Nullable String tenant; |
| 74 | + |
| 75 | + /** |
| 76 | + * Creates a new Builder with all fields unset. |
| 77 | + */ |
| 78 | + private Builder() { |
| 79 | + } |
| 80 | + |
| 81 | + /** |
| 82 | + * Sets the id. |
| 83 | + * |
| 84 | + * @param id the task identifier (required) |
| 85 | + * @return this builder for method chaining |
| 86 | + */ |
| 87 | + public Builder id(String id) { |
| 88 | + this.id = id; |
| 89 | + return this; |
| 90 | + } |
| 91 | + |
| 92 | + /** |
| 93 | + * Sets the pageSize. |
| 94 | + * |
| 95 | + * @param pageSize the maximum number of items to return per page |
| 96 | + * @return this builder for method chaining |
| 97 | + */ |
| 98 | + public Builder pageSize(Integer pageSize) { |
| 99 | + this.pageSize = pageSize; |
| 100 | + return this; |
| 101 | + } |
| 102 | + |
| 103 | + /** |
| 104 | + * Sets the pageToken. |
| 105 | + * |
| 106 | + * @param pageToken the pagination token for the next page |
| 107 | + * @return this builder for method chaining |
| 108 | + */ |
| 109 | + public Builder pageToken(String pageToken) { |
| 110 | + this.pageToken = pageToken; |
| 111 | + return this; |
| 112 | + } |
| 113 | + |
| 114 | + /** |
| 115 | + * Sets the tenant. |
| 116 | + * |
| 117 | + * @param tenant the tenant identifier |
| 118 | + * @return this builder for method chaining |
| 119 | + */ |
| 120 | + public Builder tenant(String tenant) { |
| 121 | + this.tenant = tenant; |
| 122 | + return this; |
| 123 | + } |
| 124 | + |
| 125 | + /** |
| 126 | + * Builds the ListTaskPushNotificationConfigParams. |
| 127 | + * |
| 128 | + * @return a new ListTaskPushNotificationConfigParams instance |
| 129 | + * @throws IllegalArgumentException if id is null |
| 130 | + */ |
| 131 | + public ListTaskPushNotificationConfigParams build() { |
| 132 | + return new ListTaskPushNotificationConfigParams( |
| 133 | + Assert.checkNotNullParam("id", id), |
| 134 | + pageSize != null ? pageSize : 0, |
| 135 | + pageToken != null ? pageToken : "", |
| 136 | + Utils.defaultIfNull(tenant,"") |
| 137 | + ); |
| 138 | + } |
| 139 | + } |
54 | 140 | } |
0 commit comments