Skip to content

Commit

Permalink
Make better use of java8 stream
Browse files Browse the repository at this point in the history
Signed-off-by: Khor Shu Heng <[email protected]>
  • Loading branch information
陈易生 authored and khorshuheng committed Mar 10, 2021
1 parent 7899bd5 commit 2833750
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions core/src/main/java/feast/core/model/FeatureTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -359,13 +359,13 @@ public void delete() {

public String protoHash() {
List<String> sortedEntities =
this.getEntities().stream().map(entity -> entity.getName()).collect(Collectors.toList());
Collections.sort(sortedEntities);
this.getEntities().stream().map(EntityV2::getName).sorted().collect(Collectors.toList());

List<FeatureV2> sortedFeatures = new ArrayList(this.getFeatures());
List<FeatureSpecV2> sortedFeatureSpecs =
sortedFeatures.stream().map(featureV2 -> featureV2.toProto()).collect(Collectors.toList());
sortedFeatures.sort(Comparator.comparing(FeatureV2::getName));
this.getFeatures().stream()
.sorted(Comparator.comparing(FeatureV2::getName))
.map(FeatureV2::toProto)
.collect(Collectors.toList());

DataSourceProto.DataSource streamSource = DataSourceProto.DataSource.getDefaultInstance();
if (getStreamSource() != null) {
Expand Down

0 comments on commit 2833750

Please sign in to comment.