Class NamedInterfaces.Builder
- Enclosing class:
- NamedInterfaces
NamedInterfaces
instances. Allows selecting packages to create
NamedInterface
instances for based on excluding and including predicates, name matches etc. Will always
include the unnamed named interface as it's required for a valid application module.- Since:
- 1.4
- Author:
- Oliver Drotbohm
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Creates aNamedInterfaces
instance according to the builder setup.Excludes the packages with the given name expressions from being considered as named interface.excluding
(Collection<String> expressions) Excludes the packages with the given name expressions from being considered as named interface.excluding
(Predicate<JavaPackage> exclusions) Excludes the packages matching the givenPredicate
from being considered as named interface.including
(Predicate<JavaPackage> inclusions) Adds all packages matching the given predicate as named interface.Adds all packages with the trailing name relative to the base package matching the given names or expressions, unless set up to be excluded (seeexcluding(Predicate)
and overloads)..matching
(Collection<String> names) Adds all packages with the trailing name relative to the base package matching the given names or expressions, unless set up to be excluded (seeexcluding(Predicate)
and overloads).Configures the builder to not only consider directly nested packages but also ones nested in those.
-
Method Details
-
recursive
Configures the builder to not only consider directly nested packages but also ones nested in those.- Returns:
- will never be null.
-
matching
Adds all packages with the trailing name relative to the base package matching the given names or expressions, unless set up to be excluded (seeexcluding(Predicate)
and overloads).. For a base packagecom.acme
, the trailing name of packagecom.acme.foo
would befoo
. Forcom.acme.foo.bar
it would befoo.bar
.Expressions can use wildcards, such as * (for multi-character matches) and ? (for single-character ones). As soon as an expression contains a dot (.), the expression is applied to the entire trailing name. Expressions with a dot are applied to all name segments individually. In other words, an expression
foo
would match both the trailing namesfoo
,foo.bar
, andbar.foo
.- Parameters:
names
- must not be null.- Returns:
- will never be null.
- See Also:
-
matching
Adds all packages with the trailing name relative to the base package matching the given names or expressions, unless set up to be excluded (seeexcluding(Predicate)
and overloads). For a base packagecom.acme
, the trailing name of packagecom.acme.foo
would befoo
. Forcom.acme.foo.bar
it would befoo.bar
.Expressions can use wildcards, such as * (for multi-character matches) and ? (for single-character ones). As soon as an expression contains a dot (.), the expression is applied to the entire trailing name. Expressions with a dot are applied to all name segments individually. In other words, an expression
foo
would match both the trailing namesfoo
,foo.bar
, andbar.foo
.- Parameters:
names
- must not be null.- Returns:
- will never be null.
- See Also:
-
including
Adds all packages matching the given predicate as named interface.- Parameters:
inclusions
- must not be null.- Returns:
- will never be null.
- See Also:
-
excluding
Excludes the packages with the given name expressions from being considered as named interface. Seematching(String...)
for details on matching expressions.- Parameters:
expressions
- must not be null.- Returns:
- will never be null.
- See Also:
-
excluding
Excludes the packages with the given name expressions from being considered as named interface. Seematching(Collection)
for details on matching expressions.- Parameters:
expressions
- must not be null.- Returns:
- will never be null.
- See Also:
-
excluding
Excludes the packages matching the givenPredicate
from being considered as named interface.- Parameters:
exclusions
- must not be null.- Returns:
- will never be null.
- See Also:
-
build
Creates aNamedInterfaces
instance according to the builder setup. Will always include the unnamed interface established by theJavaPackage
theNamedInterfaces.Builder
was set up for originally, as it's a required abstraction for every application module.- Returns:
- will never be null.
-