Class Selection<T>
java.lang.Object
co.yellowdog.platform.model.Selection<T>
- Type Parameters:
T- the type of element being selected
- All Implemented Interfaces:
Serializable
@ValidatedBy(SelectionValidator.class)
public class Selection<T>
extends Object
implements Serializable
A selection of elements defined by an includes list, an excludes list, or both.
The matching semantics are as follows:
- Include only the selection matches any element that appears in
includes. - Exclude only the selection matches any element that does not appear in
excludes. - Both specified
includestakes precedence; the effective set is theincludeslist with any elements also present inexcludesremoved. Only elements that survive this filtering are matched. - Neither specified both lists are empty; the selection matches nothing.
- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Selection.Builder<T> builder()protected booleanbooleanstatic <T> Selection<T> static <T> Selection<T> excludes(T... excludes) Elements to exclude from the selection.Elements to include in the selection.inthashCode()static <T> Selection<T> static <T> Selection<T> includes(T... includes) voidsetExcludes(List<T> excludes) Elements to exclude from the selection.voidsetIncludes(List<T> includes) Elements to include in the selection.toString()
-
Constructor Details
-
Selection
Creates a newSelectioninstance.- Parameters:
includes- Elements to include in the selection.When non-empty, only elements present in this list are candidates for matching (subject to further filtering by
excludes).excludes- Elements to exclude from the selection.When
includesis empty, this list defines the set of elements that are not matched. Whenincludesis non-empty, elements present in both lists are removed from the effective include set.
-
-
Method Details
-
includes
-
includes
-
excludes
-
excludes
-
builder
-
getIncludes
-
getExcludes
-
setIncludes
-
setExcludes
-
equals
-
canEqual
-
hashCode
-
toString
-