@@ -49,6 +49,7 @@ public static final class Deserializer implements JsonDeserializer<ReplayType> {
4949 private @ Nullable List <String > urls ;
5050 private @ Nullable List <String > errorIds ;
5151 private @ Nullable List <String > traceIds ;
52+ private @ Nullable List <String > segmentNames ;
5253 private @ Nullable Map <String , Object > unknown ;
5354
5455 public SentryReplayEvent () {
@@ -58,6 +59,7 @@ public SentryReplayEvent() {
5859 this .replayType = ReplayType .SESSION ;
5960 this .errorIds = new ArrayList <>();
6061 this .traceIds = new ArrayList <>();
62+ this .segmentNames = new ArrayList <>();
6163 this .urls = new ArrayList <>();
6264 timestamp = DateUtils .getCurrentDateTime ();
6365 }
@@ -142,6 +144,15 @@ public void setTraceIds(final @Nullable List<String> traceIds) {
142144 this .traceIds = traceIds ;
143145 }
144146
147+ @ Nullable
148+ public List <String > getSegmentNames () {
149+ return segmentNames ;
150+ }
151+
152+ public void setSegmentNames (final @ Nullable List <String > segmentNames ) {
153+ this .segmentNames = segmentNames ;
154+ }
155+
145156 @ NotNull
146157 public ReplayType getReplayType () {
147158 return replayType ;
@@ -162,12 +173,13 @@ public boolean equals(Object o) {
162173 && Objects .equals (replayId , that .replayId )
163174 && Objects .equals (urls , that .urls )
164175 && Objects .equals (errorIds , that .errorIds )
165- && Objects .equals (traceIds , that .traceIds );
176+ && Objects .equals (traceIds , that .traceIds )
177+ && Objects .equals (segmentNames , that .segmentNames );
166178 }
167179
168180 @ Override
169181 public int hashCode () {
170- return Objects .hash (type , replayType , replayId , segmentId , urls , errorIds , traceIds );
182+ return Objects .hash (type , replayType , replayId , segmentId , urls , errorIds , traceIds , segmentNames );
171183 }
172184
173185 // region json
@@ -181,6 +193,7 @@ public static final class JsonKeys {
181193 public static final String URLS = "urls" ;
182194 public static final String ERROR_IDS = "error_ids" ;
183195 public static final String TRACE_IDS = "trace_ids" ;
196+ public static final String SEGMENT_NAMES = "segment_names" ;
184197 }
185198
186199 @ Override
@@ -207,6 +220,9 @@ public void serialize(final @NotNull ObjectWriter writer, final @NotNull ILogger
207220 if (traceIds != null ) {
208221 writer .name (JsonKeys .TRACE_IDS ).value (logger , traceIds );
209222 }
223+ if (segmentNames != null ) {
224+ writer .name (JsonKeys .SEGMENT_NAMES ).value (logger , segmentNames );
225+ }
210226
211227 new SentryBaseEvent .Serializer ().serialize (this , writer , logger );
212228
@@ -250,6 +266,7 @@ public static final class Deserializer implements JsonDeserializer<SentryReplayE
250266 @ Nullable List <String > urls = null ;
251267 @ Nullable List <String > errorIds = null ;
252268 @ Nullable List <String > traceIds = null ;
269+ @ Nullable List <String > segmentNames = null ;
253270
254271 reader .beginObject ();
255272 while (reader .peek () == JsonToken .NAME ) {
@@ -282,6 +299,9 @@ public static final class Deserializer implements JsonDeserializer<SentryReplayE
282299 case JsonKeys .TRACE_IDS :
283300 traceIds = (List <String >) reader .nextObjectOrNull ();
284301 break ;
302+ case JsonKeys .SEGMENT_NAMES :
303+ segmentNames = (List <String >) reader .nextObjectOrNull ();
304+ break ;
285305 default :
286306 if (!baseEventDeserializer .deserializeValue (replay , nextName , reader , logger )) {
287307 if (unknown == null ) {
@@ -311,6 +331,7 @@ public static final class Deserializer implements JsonDeserializer<SentryReplayE
311331 replay .setUrls (urls );
312332 replay .setErrorIds (errorIds );
313333 replay .setTraceIds (traceIds );
334+ replay .setSegmentNames (segmentNames );
314335 replay .setUnknown (unknown );
315336 return replay ;
316337 }
0 commit comments