# Uses of Class
org.apache.sling.discovery.commons.InstancesDiff.InstanceCollection

Packages that use InstancesDiff.InstanceCollection
Package
Description
org.apache.sling.discovery.commons
Provides commons utility for users for the Discovery API.

## Uses of InstancesDiff.InstanceCollection in org.apache.sling.discovery.commons

Methods in org.apache.sling.discovery.commons that return InstancesDiff.InstanceCollection
Modifier and Type
Method
Description
`@NotNull InstancesDiff.InstanceCollection`
InstancesDiff.`added()`
Returns the `InstanceCollection` collection containing the `InstanceDescription` instances that are contained in the new collection but not in the old collection.
`@NotNull InstancesDiff.InstanceCollection`
InstancesDiff.`all(boolean retainFromNewCollection)`
Returns the `InstanceSet` set containing the `InstanceDescription` instances that are contained in either the old or the new collection.
`@NotNull InstancesDiff.InstanceCollection`
InstancesDiff.InstanceCollection.`filterWith(@Nullable org.apache.sling.discovery.InstanceFilter filter)`
Filter the instances with a custom `InstanceFilter` filter.
`@NotNull InstancesDiff.InstanceCollection`
InstancesDiff.InstanceCollection.`isInClusterView(@Nullable org.apache.sling.discovery.ClusterView clusterView)`
Keep only the instances that are contained in the same `ClusterView` cluster view as the one provided.
`@NotNull InstancesDiff.InstanceCollection`
InstancesDiff.InstanceCollection.`isLeader()`
Keep only the leader instances (see `InstanceDescription.isLeader()`.
`@NotNull InstancesDiff.InstanceCollection`
InstancesDiff.InstanceCollection.`isLocal()`
Keep only the local instance (see `InstanceDescription.isLocal()`.
`@NotNull InstancesDiff.InstanceCollection`
InstancesDiff.InstanceCollection.`isNotInClusterView(@Nullable org.apache.sling.discovery.ClusterView clusterView)`
Filter out the instances that are contained in the same `ClusterView` cluster view as the one provided.
`@NotNull InstancesDiff.InstanceCollection`
InstancesDiff.InstanceCollection.`isNotLeader()`
Filter out the leader instances (see `InstanceDescription.isLeader()`.
`@NotNull InstancesDiff.InstanceCollection`
InstancesDiff.InstanceCollection.`isNotLocal()`
Filter out the local instances (see `InstanceDescription.isLocal()`.
`@NotNull InstancesDiff.InstanceCollection`
InstancesDiff.`removed()`
Returns the `InstanceCollection` collection containing the `InstanceDescription` instances that are contained in the old collection but not in the new collection.
`@NotNull InstancesDiff.InstanceCollection`
InstancesDiff.`retained(boolean retainFromNewCollection)`
Returns the `InstanceSet` collection containing the `InstanceDescription` instances that are contained in both the old collection and the new collection.
`@NotNull InstancesDiff.InstanceCollection`
InstancesDiff.`retained(boolean retainFromNewCollection, boolean propertyChanged)`
Returns the `InstanceCollection` collection containing the `InstanceDescription` instances that are contained in both the old and the new collections.