Skip to content

Commit

Permalink
introduced ResolvedFieldAccessor
Browse files Browse the repository at this point in the history
  • Loading branch information
normen662 committed Nov 8, 2022
1 parent 5d87de1 commit 4092b55
Show file tree
Hide file tree
Showing 10 changed files with 244 additions and 128 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ private static void addCoveringField(@Nonnull IndexKeyValueToPartialRecord.Build
@Nonnull AvailableFields.FieldData fieldData) {
// TODO field names are for debugging purposes only, we should probably use field ordinals here instead.
final var simplifiedFieldValue = (FieldValue)fieldValue.simplify(AliasMap.emptyMap(), ImmutableSet.of());
for (final var maybeFieldName : simplifiedFieldValue.getFieldPrefix().getFieldNamesMaybe()) {
for (final var maybeFieldName : simplifiedFieldValue.getFieldPrefix().getOptionalFieldNames()) {
Verify.verify(maybeFieldName.isPresent());
builder = builder.getFieldBuilder(maybeFieldName.get());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ private static boolean addCoveringField(@Nonnull IndexKeyValueToPartialRecord.Bu
@Nonnull FieldValue fieldValue,
@Nonnull AvailableFields.FieldData fieldData) {
// TODO field names are for debugging purposes only, we should probably use field ordinals here instead.
for (final var maybeFieldName : fieldValue.getFieldPrefix().getFieldNamesMaybe()) {
for (final var maybeFieldName : fieldValue.getFieldPrefix().getOptionalFieldNames()) {
if (maybeFieldName.isEmpty()) {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ private static boolean addCoveringField(@Nonnull IndexKeyValueToPartialRecord.Bu
@Nonnull FieldValue fieldValue,
@Nonnull AvailableFields.FieldData fieldData) {
// TODO field names are for debugging purposes only, we should probably use field ordinals here instead.
for (final var maybeFieldName : fieldValue.getFieldPrefix().getFieldNamesMaybe()) {
for (final var maybeFieldName : fieldValue.getFieldPrefix().getOptionalFieldNames()) {
if (maybeFieldName.isEmpty()) {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public static <V extends Value> BindingMatcher<FieldValue> fieldValueWithFieldPa
downstreamValue);
final TypedMatcherWithExtractAndDownstream<FieldValue> downstreamFieldPathOrdinalsMatcher =
typedWithDownstream(FieldValue.class,
Extractor.of(f -> f.getFieldPathOrdinals().asList(), name -> "fieldPathOrdinals(" + name + ")"),
Extractor.of(f -> f.getFieldOrdinals().asList(), name -> "fieldPathOrdinals(" + name + ")"),
downstreamFieldPathOrdinals);
final TypedMatcherWithExtractAndDownstream<FieldValue> downstreamFieldPathTypesMatcher =
typedWithDownstream(FieldValue.class,
Expand Down
Loading

0 comments on commit 4092b55

Please sign in to comment.