public static final class DOFQuery.Builder
extends java.lang.Object
DOFQuery
.
Builder supports a fluent style of programming -- code like the following is encouraged:
DOFQuery query = new DOFQuery.Builder()
.addFilter(...)
.addFilter(...)
.build();
Constructor and Description |
---|
Builder()
Construct a DOFQuery.Builder.
|
Builder(DOFQuery query)
Construct a DOFQuery.Builder based on another DOFQuery.
|
Modifier and Type | Method and Description |
---|---|
DOFQuery.Builder |
addFilter(java.util.Collection<DOFInterfaceID> interfaceIDs)
Add a filter for specific objects that currently provide all of the interfaces specified.
|
DOFQuery.Builder |
addFilter(java.util.Collection<DOFObjectID> objectIDs,
java.util.Collection<DOFInterfaceID> interfaceIDs)
Add a filter for specific Device Objects by providing a List of DOFObjectIDs.
|
DOFQuery.Builder |
addFilter(DOFInterfaceID... interfaceIDs)
Add a filter for specific DOFObjects that currently provide the Object Interface specified.
|
DOFQuery.Builder |
addFilter(DOFObjectID objectID)
Add filter for a specific Device Object, as specified by a Device Object identifier, regardless of interfaces
provided.
|
DOFQuery.Builder |
addFilter(DOFObjectID objectID,
java.util.Collection<DOFInterfaceID> interfaceIDs)
Add a filter for a specific Device Object as specified by a Device Object identifier.
|
DOFQuery.Builder |
addFilter(DOFObjectID objectID,
DOFInterfaceID interfaceID)
Add a filter for a specific Device Object that provides the specified interface.
|
DOFQuery.Builder |
addRestriction(java.util.Collection<DOFInterfaceID> interfaceIDs)
Restrict filter notification to a set of interface identifiers.
|
DOFQuery.Builder |
addRestriction(DOFInterfaceID... interfaceIDs)
Restrict filter notification to a set of interface identifiers.
|
DOFQuery |
build()
Construct a new DOFQuery based on the builder's current filter list, restriction list, and style.
|
DOFQuery.Builder |
setMatchStyle(DOFQuery.MatchStyle matchStyle)
Set the matching style to use in processing this query.
|
public Builder()
public Builder(DOFQuery query)
query
- The existing DOFQuery. Must not be null.public DOFQuery.Builder addFilter(java.util.Collection<DOFObjectID> objectIDs, java.util.Collection<DOFInterfaceID> interfaceIDs)
DOFQuery
.objectIDs
- The objects to filter. Must not be null and must not contain non-unicast (broadcast or multicast) id's.interfaceIDs
- The interfaces to filter. May be null.DOFObjectID
,
DOFInterfaceID
public DOFQuery.Builder addFilter(DOFObjectID objectID, java.util.Collection<DOFInterfaceID> interfaceIDs)
DOFQuery
.objectID
- The object to filter. This must not be null and must be a unicast (not broadcast or multicast) id.interfaceIDs
- The interfaces to filter. May be null.addFilter(java.util.Collection<org.opendof.core.oal.DOFObjectID>, java.util.Collection<org.opendof.core.oal.DOFInterfaceID>)
public DOFQuery.Builder addFilter(DOFObjectID objectID, DOFInterfaceID interfaceID)
DOFQuery
.objectID
- The object to filter. Must not be null and must be a unicast (not broadcast or multicast) id.interfaceID
- The interface to filter.addFilter(java.util.Collection<org.opendof.core.oal.DOFObjectID>, java.util.Collection<org.opendof.core.oal.DOFInterfaceID>)
public DOFQuery.Builder addFilter(DOFObjectID objectID)
DOFQuery
.objectID
- The object to filter. Must not be null and must be a unicast (not broadcast or multicast) id.addFilter(java.util.Collection<org.opendof.core.oal.DOFObjectID>, java.util.Collection<org.opendof.core.oal.DOFInterfaceID>)
public DOFQuery.Builder addFilter(java.util.Collection<DOFInterfaceID> interfaceIDs)
DOFQuery
.interfaceIDs
- The list of interface identifiers that the filter is for. This must not be null.addFilter(java.util.Collection<org.opendof.core.oal.DOFObjectID>, java.util.Collection<org.opendof.core.oal.DOFInterfaceID>)
public DOFQuery.Builder addFilter(DOFInterfaceID... interfaceIDs)
DOFQuery
.interfaceIDs
- The interface identifiers that the filter is for.addFilter(java.util.Collection<org.opendof.core.oal.DOFObjectID>, java.util.Collection<org.opendof.core.oal.DOFInterfaceID>)
public DOFQuery.Builder addRestriction(DOFInterfaceID... interfaceIDs)
DOFQuery
.interfaceIDs
- The interfaces to restrict filter notification to. This must not be nullDOFInterfaceID
,
addRestriction(Collection)
public DOFQuery.Builder addRestriction(java.util.Collection<DOFInterfaceID> interfaceIDs)
DOFQuery
.interfaceIDs
- The interfaces (DOFInterfaceIDs) to restrict filter to. This must not be null.DOFInterfaceID
public DOFQuery.Builder setMatchStyle(DOFQuery.MatchStyle matchStyle)
DOFQuery
.matchStyle
- The matching style. The default is DOFQuery.MatchStyle.AT_LEAST
. null
means default.public DOFQuery build()