Class ReplicaSets

java.lang.Object
io.debezium.connector.mongodb.ReplicaSets

@Immutable public class ReplicaSets extends Object
A set of replica set specifications.
Author:
Randall Hauch
  • Field Details

  • Constructor Details

    • ReplicaSets

      public ReplicaSets(Collection<ReplicaSet> rsSpecs)
      Create a set of replica set specifications.
      Parameters:
      rsSpecs - the replica set specifications; may be null or empty
  • Method Details

    • empty

      public static ReplicaSets empty()
      Get an instance that contains no replica sets.
      Returns:
      the empty instance; never null
    • of

      public static ReplicaSets of(ReplicaSet... replicaSets)
    • size

      public int size()
      Get the number of replica sets.
      Returns:
      the replica set count
    • onEachReplicaSet

      public void onEachReplicaSet(Consumer<ReplicaSet> function)
      Perform the supplied function on each of the replica sets
      Parameters:
      function - the consumer function; may not be null
    • subdivide

      public void subdivide(int maxSubdivisionCount, Consumer<ReplicaSets> subdivisionConsumer)
      Subdivide this collection of replica sets into the maximum number of groups.
      Parameters:
      maxSubdivisionCount - the maximum number of subdivisions
      subdivisionConsumer - the function to be called with each subdivision; may not be null
    • all

      public List<ReplicaSet> all()
      Get a copy of all of the ReplicaSet objects.
      Returns:
      the replica set objects; never null but possibly empty
    • haveChangedSince

      public boolean haveChangedSince(ReplicaSets priorState)
      Determine if one or more replica sets has been added or removed since the prior state.
      Parameters:
      priorState - the prior state of the replica sets; may be null
      Returns:
      true if the replica sets have changed since the prior state, or false otherwise
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object