Package org.apache.cassandra.locator
Interface ReplicaCollection.Builder<C extends ReplicaCollection<C>>
- All Superinterfaces:
Iterable<Replica>,ReplicaCollection<C>
- All Known Implementing Classes:
EndpointsForRange.Builder,EndpointsForToken.Builder,RangesAtEndpoint.Builder
- Enclosing interface:
- ReplicaCollection<C extends ReplicaCollection<C>>
public static interface ReplicaCollection.Builder<C extends ReplicaCollection<C>>
extends ReplicaCollection<C>
A mutable (append-only) extension of a ReplicaCollection.
All methods besides add() will return an immutable snapshot of the collection, or the matching items.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumPassed to add() and addAll() as ignoreConflicts parameter.Nested classes/interfaces inherited from interface org.apache.cassandra.locator.ReplicaCollection
ReplicaCollection.Builder<C extends ReplicaCollection<C>> -
Method Summary
Modifier and TypeMethodDescriptiondefault ReplicaCollection.Builder<C>add(Replica replica, ReplicaCollection.Builder.Conflict ignoreConflict) default ReplicaCollection.Builder<C>default ReplicaCollection.Builder<C>addAll(Iterable<Replica> replicas, ReplicaCollection.Builder.Conflict ignoreConflicts) build()snapshot()Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
build
C build()- Returns:
- an Immutable clone that assumes this Builder will never be modified again, so its contents can be reused. This Builder should enforce that it is no longer modified.
-
snapshot
C snapshot()- Returns:
- an Immutable clone that assumes this Builder will be modified again
-
add
ReplicaCollection.Builder<C> add(Replica replica, ReplicaCollection.Builder.Conflict ignoreConflict) - Parameters:
replica- add this replica to the end of the collectionignoreConflict- conflicts to ignore, seeReplicaCollection.Builder.Conflict
-
add
-
addAll
default ReplicaCollection.Builder<C> addAll(Iterable<Replica> replicas, ReplicaCollection.Builder.Conflict ignoreConflicts) -
addAll
-