This repository has been archived by the owner on Jun 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pass through the updated entity ids (#161)
- Loading branch information
1 parent
262fd0a
commit 1c33b3c
Showing
4 changed files
with
51 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 23 additions & 1 deletion
24
...rtrace/gateway/service/entity/converter/BulkUpdateAllMatchingFilterResponseConverter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,37 @@ | ||
package org.hypertrace.gateway.service.entity.converter; | ||
|
||
import static java.util.stream.Collectors.toUnmodifiableList; | ||
|
||
import org.hypertrace.entity.query.service.v1.BulkUpdateAllMatchingFilterResponse; | ||
import org.hypertrace.entity.query.service.v1.UpdateSummary; | ||
import org.hypertrace.gateway.service.common.converters.Converter; | ||
import org.hypertrace.gateway.service.v1.entity.BulkUpdateAllMatchingEntitiesResponse; | ||
import org.hypertrace.gateway.service.v1.entity.EntityUpdateSummary; | ||
import org.hypertrace.gateway.service.v1.entity.UpdatedEntity; | ||
|
||
public class BulkUpdateAllMatchingFilterResponseConverter | ||
implements Converter< | ||
BulkUpdateAllMatchingFilterResponse, BulkUpdateAllMatchingEntitiesResponse> { | ||
@Override | ||
public BulkUpdateAllMatchingEntitiesResponse convert( | ||
final BulkUpdateAllMatchingFilterResponse source) { | ||
return BulkUpdateAllMatchingEntitiesResponse.newBuilder().build(); | ||
return BulkUpdateAllMatchingEntitiesResponse.newBuilder() | ||
.addAllSummaries( | ||
source.getSummariesList().stream().map(this::convert).collect(toUnmodifiableList())) | ||
.build(); | ||
} | ||
|
||
private EntityUpdateSummary convert(final UpdateSummary summary) { | ||
return EntityUpdateSummary.newBuilder() | ||
.addAllUpdatedEntities( | ||
summary.getUpdatedEntitiesList().stream() | ||
.map(this::convert) | ||
.collect(toUnmodifiableList())) | ||
.build(); | ||
} | ||
|
||
private UpdatedEntity convert( | ||
final org.hypertrace.entity.query.service.v1.UpdatedEntity updatedEntity) { | ||
return UpdatedEntity.newBuilder().setId(updatedEntity.getId()).build(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters