public final class InstancesDiff.InstanceCollection extends 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 |
---|---|
InstancesDiff.InstanceCollection |
filterWith(InstanceFilter filter)
Filter the instances with a custom
InstanceFilter filter. |
Collection<InstanceDescription> |
get()
Return the collection of
InstanceDescription instances that have not been filtered out. |
InstancesDiff.InstanceCollection |
isInClusterView(ClusterView clusterView)
Keep only the instances that are contained in the same
ClusterView cluster view
as the one provided. |
InstancesDiff.InstanceCollection |
isLeader()
Keep only the leader instances (see
InstanceDescription.isLeader() . |
InstancesDiff.InstanceCollection |
isLocal()
Keep only the local instance (see
InstanceDescription.isLocal() . |
InstancesDiff.InstanceCollection |
isNotInClusterView(ClusterView clusterView)
Filter out the instances that are contained in the same
ClusterView cluster view
as the one provided. |
InstancesDiff.InstanceCollection |
isNotLeader()
Filter out the leader instances (see
InstanceDescription.isLeader() . |
InstancesDiff.InstanceCollection |
isNotLocal()
Filter out the local instances (see
InstanceDescription.isLocal() . |
@Nonnull public InstancesDiff.InstanceCollection filterWith(@Nullable InstanceFilter filter)
InstanceFilter
filter.filter
- the filter to be applied on the instancesthis
@Nonnull public InstancesDiff.InstanceCollection isLocal()
InstanceDescription.isLocal()
.this
@Nonnull public InstancesDiff.InstanceCollection isNotLocal()
InstanceDescription.isLocal()
.this
@Nonnull public InstancesDiff.InstanceCollection isLeader()
InstanceDescription.isLeader()
.this
@Nonnull public InstancesDiff.InstanceCollection isNotLeader()
InstanceDescription.isLeader()
.this
@Nonnull public InstancesDiff.InstanceCollection isInClusterView(@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
@Nonnull public InstancesDiff.InstanceCollection isNotInClusterView(@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
@Nonnull public Collection<InstanceDescription> get()
InstanceDescription
instances that have not been filtered out.Copyright © 2017 The Apache Software Foundation. All rights reserved.