Skip to content
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1277 from finos/remove-wrappeddatabag
Browse files Browse the repository at this point in the history
refactor(#1235): remove wrappedDataBag
  • Loading branch information
pdaulbyscottlogic authored Sep 2, 2019
2 parents 3d93f1d + 1ccd929 commit 01ee3a1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -216,12 +216,15 @@ private static DataBagGroupWrapper acceptNextRandomValue(DataBagGroupWrapper wra
}

private static Stream<DataBagGroupWrapper> acceptNextNonRandomValue(DataBagGroupWrapper wrapper, Field field) {
FieldSpecGroup group = wrapper.group();
return wrapper.generator().generate(field, group.fieldSpecs().get(field))
.map(value -> new WrappedDataBag(toDataBag(field, value), value))
.map(wrapped -> new WrappedDataBag(DataBag.merge(wrapped.dataBag(), wrapper.dataBag()), wrapped.value()))
.map(combined -> new DataBagGroupWrapper(
combined.dataBag(), adjustBounds(field, combined.value(), wrapper.group()), wrapper.generator())
);
return wrapper.generator()
.generate(field, wrapper.group().fieldSpecs().get(field))
.map(value -> getWrappedDataBag(wrapper, field, value));
}

private static DataBagGroupWrapper getWrappedDataBag(DataBagGroupWrapper wrapper, Field field, DataBagValue value) {
DataBag dataBag = toDataBag(field, value);
DataBag merged = DataBag.merge(dataBag, wrapper.dataBag());

return new DataBagGroupWrapper(merged, adjustBounds(field, value, wrapper.group()), wrapper.generator());
}
}

This file was deleted.

0 comments on commit 01ee3a1

Please sign in to comment.