public final class InstancesDiff.InstanceCollection
extends java.lang.Object
InstanceCollection
collection allows to filter the instances using a set of custom filter
either implementing InstanceFilter
or pre-defined ones.Filters conditions are joined combined together using the logical operator "AND".
Modifier and Type | Method and Description |
---|---|
@NotNull InstancesDiff.InstanceCollection |
filterWith(@Nullable InstanceFilter filter)
Filter the instances with a custom
InstanceFilter filter. |
@NotNull java.util.Collection<InstanceDescription> |
get()
Return the collection of
InstanceDescription instances that have not been filtered out. |
@NotNull InstancesDiff.InstanceCollection |
isInClusterView(@Nullable ClusterView clusterView)
Keep only the instances that are contained in the same
ClusterView cluster view
as the one provided. |
@NotNull InstancesDiff.InstanceCollection |
isLeader()
Keep only the leader instances (see
InstanceDescription.isLeader() . |
@NotNull InstancesDiff.InstanceCollection |
isLocal()
Keep only the local instance (see
InstanceDescription.isLocal() . |
@NotNull InstancesDiff.InstanceCollection |
isNotInClusterView(@Nullable ClusterView clusterView)
Filter out the instances that are contained in the same
ClusterView cluster view
as the one provided. |
@NotNull InstancesDiff.InstanceCollection |
isNotLeader()
Filter out the leader instances (see
InstanceDescription.isLeader() . |
@NotNull InstancesDiff.InstanceCollection |
isNotLocal()
Filter out the local instances (see
InstanceDescription.isLocal() . |
@NotNull public @NotNull InstancesDiff.InstanceCollection filterWith(@Nullable @Nullable InstanceFilter filter)
InstanceFilter
filter.filter
- the filter to be applied on the instancesthis
@NotNull public @NotNull InstancesDiff.InstanceCollection isLocal()
InstanceDescription.isLocal()
.this
@NotNull public @NotNull InstancesDiff.InstanceCollection isNotLocal()
InstanceDescription.isLocal()
.this
@NotNull public @NotNull InstancesDiff.InstanceCollection isLeader()
InstanceDescription.isLeader()
.this
@NotNull public @NotNull InstancesDiff.InstanceCollection isNotLeader()
InstanceDescription.isLeader()
.this
@NotNull public @NotNull InstancesDiff.InstanceCollection isInClusterView(@Nullable @Nullable ClusterView clusterView)
ClusterView
cluster view
as the one provided.The comparison between cluster views is done on the basis of the cluster view identifier. Two cluster views with the same identifier are considered equal.
clusterView
- the cluster view used to filter the instancesthis
@NotNull public @NotNull InstancesDiff.InstanceCollection isNotInClusterView(@Nullable @Nullable ClusterView clusterView)
ClusterView
cluster view
as the one provided.The comparison between cluster views is done on the basis of the cluster view identifier. Two cluster views with the same identifier are considered equal.
clusterView
- the cluster view used to filter the instancesthis
@NotNull public @NotNull java.util.Collection<InstanceDescription> get()
InstanceDescription
instances that have not been filtered out.Copyright © 2022 The Apache Software Foundation. All rights reserved.