@API(value=EXPERIMENTAL) public class RepeatedFieldSource extends Source
Source
representing the stream of the zero or more values of a repeated field.
Encapsulates the logic for fanning-out the values of the repeated field and ensuring that the planner uses repeated
fields in the correct way. In particular, the supportsSourceIn(ViewExpressionComparisons, Source)
method
ensures that multiple comparisons are associated with this source only if they can refer to the same iteration over
the elements of the repeated field.
Constructor and Description |
---|
RepeatedFieldSource(Source source,
List<String> fieldNames) |
RepeatedFieldSource(Source source,
String fieldName) |
Modifier and Type | Method and Description |
---|---|
Stream<SourceEntry> |
evalSourceEntriesFor(SourceEntry parentEntry)
Produce the stream of source entries that this source represents, drawing the values for dependent sources
from the given source entry if needed.
|
List<String> |
getFieldNames() |
Source |
getParent() |
Set<Source> |
getSources()
Get the set of all sources of ancestor's of this source, include this source itself.
|
boolean |
supportsSourceIn(ViewExpressionComparisons comparisons,
Source other)
Check whether this source can be replaced by the given source in the given
ViewExpressionComparisons . |
String |
toString() |
Source |
withSourceMappedInto(Source originalSource,
Source duplicateSource)
Replace the given duplicate source with the given original source everywhere that it occurs in this source,
including in ancestor sources.
|
addDependentSource, equals, evalSourceEntriesFor, hashCode
public Set<Source> getSources()
Source
getSources
in class Source
public boolean supportsSourceIn(@Nonnull ViewExpressionComparisons comparisons, @Nonnull Source other)
Source
ViewExpressionComparisons
.
In general, this source can be replaced by the given source if and only if:
ViewExpressionComparisons
do not use this source.supportsSourceIn
in class Source
comparisons
- a view expression comparisons that specifies which sources are used and unusedother
- a candidate replacement for this sourceother
Source.withSourceMappedInto(Source, Source)
,
Element.matchSourcesWith(ViewExpressionComparisons, Element)
@Nonnull public Source withSourceMappedInto(@Nonnull Source originalSource, @Nonnull Source duplicateSource)
Source
withSourceMappedInto
in class Source
originalSource
- a source to replace all occurrences of the duplicate source withduplicateSource
- a source to replace with the original source@Nonnull public Stream<SourceEntry> evalSourceEntriesFor(@Nonnull SourceEntry parentEntry)
Source
evalSourceEntriesFor
in class Source
parentEntry
- a source entry to draw the input for this source from