Package org.instancio
Interface TypeSelectorBuilder
- All Superinterfaces:
TargetSelector
- All Known Implementing Classes:
TypeSelectorBuilderImpl
A builder for constructing predicate-based type selectors.
An instance of the builder can be obtained using Select.types()
.
Other methods from this class can be chained to form logical AND
relationships, for example:
types().of(BaseEntity.class).annotated(Entity.class).annotated(Table.class)
will match BaseEntity
including its subtypes, that are annotated with
@Entity
and @Table
.
- Since:
- 1.6.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescription<A extends Annotation>
TypeSelectorBuilderMatches types annotated with the specified annotation, ignoring inherited annotations.Excludes specified class from matching.Matches specified type, including subtypes.
-
Method Details
-
of
Matches specified type, including subtypes. For example, selecting typesof(Collection.class
} will matchList
,Set
, etc.- Parameters:
type
- to match- Returns:
- selector builder
- Since:
- 1.6.0
-
annotated
Matches types annotated with the specified annotation, ignoring inherited annotations.Note: this method only matches annotations declared on classes. To select annotated fields, use
FieldSelectorBuilder.annotated(Class)
.The method can be chained to require multiple annotations.
- Type Parameters:
A
- annotation type- Parameters:
annotation
- declared annotation to match- Returns:
- selector builder
- Since:
- 1.6.0
-
excluding
Excludes specified class from matching.The method can be chained to exclude multiple types.
- Parameters:
type
- type to exclude- Returns:
- selector builder
- Since:
- 1.6.0
-