Class AliasMap.Builder
- java.lang.Object
-
- com.apple.foundationdb.record.query.plan.temp.AliasMap.Builder
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AliasMap
build()
Build a newAliasMap
.AliasMap.Builder
identitiesFor(Set<CorrelationIdentifier> aliases)
Method to update the builder to contain entriesa -> a, b -> b, ...
for each alias contained in the set ofCorrelationIdentifier
s passed in.AliasMap.Builder
put(CorrelationIdentifier source, CorrelationIdentifier target)
Put a new binding betweensource
andtarget
.AliasMap.Builder
putAll(AliasMap other)
Put all binding that are contained in anotherAliasMap
.AliasMap.Builder
zip(List<CorrelationIdentifier> left, List<CorrelationIdentifier> right)
Method to update the builder to additionally contain thezip
of two parallel lists of aliases.
-
-
-
Method Detail
-
put
@Nonnull public AliasMap.Builder put(@Nonnull CorrelationIdentifier source, @Nonnull CorrelationIdentifier target)
Put a new binding betweensource
andtarget
. Note that if there is already a binding forsource
, the binding will remain untouched iftarget.equals(oldTarget)
, it will be replaced withsource -> target
otherwise. Also, putting a binding for atarget
that already exists will fail.- Parameters:
source
- a source aliastarget
- a target alias- Returns:
this
that has been modified to containsource -> target
- Throws:
IllegalArgumentException
- iftarget
is already contained in the builder
-
putAll
@Nonnull public AliasMap.Builder putAll(@Nonnull AliasMap other)
Put all binding that are contained in anotherAliasMap
. Note that if there are already bindings for sources contained inother
, these bindings will remain untouched iftarget.equals(oldTarget)
, they will be replaced otherwise. Also, this call will fail if a target contained inother
already exists inthis
,- Parameters:
other
- anotherAliasMap
- Returns:
this
that has been modified to contain all bindings fromother
- Throws:
IllegalArgumentException
- if any target contained inother
is already contained in the builder
-
identitiesFor
@Nonnull public AliasMap.Builder identitiesFor(Set<CorrelationIdentifier> aliases)
Method to update the builder to contain entriesa -> a, b -> b, ...
for each alias contained in the set ofCorrelationIdentifier
s passed in.- Parameters:
aliases
- set of aliases that this method should create identity-bindings for- Returns:
this
that has been modified to contain identity-bindings for all aliases contained inaliases
-
zip
@Nonnull public AliasMap.Builder zip(@Nonnull List<CorrelationIdentifier> left, @Nonnull List<CorrelationIdentifier> right)
Method to update the builder to additionally contain thezip
of two parallel lists of aliases.- Parameters:
left
- one listright
- other list- Returns:
this
that has been modified to contain the zip of left and right as bindingsl -> r
;
-
-