Package io.csar
Interface ConcernRegistry
- All Superinterfaces:
Concerned
- All Known Implementing Classes:
ConcernRegistryThreadGroup
,DefaultConcernRegistry
A registry of concerns.
- Author:
- Garret Wilson
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionregisterConcern
(C concern) Registers the given concern, associating it with its concern type.registerConcern
(Class<T> concernType, C concern) Registers the given concern.default void
registerConcerns
(Concern... concerns) Registers the given concerns, associating them with their respective concern types.default void
registerConcerns
(Collection<Concern> concerns) Registers the given concerns, associating them with their respective concern types.default void
registerConcerns
(Stream<Concern> concerns) Registers the given concerns, associating them with their respective concern types.unregisterConcern
(Class<T> concernType) Unregisters a concern of the given type.Methods inherited from interface io.csar.Concerned
findConcern
-
Method Details
-
registerConcerns
Registers the given concerns, associating them with their respective concern types.- Implementation Specification:
- The default implementation delegates to
registerConcerns(Stream)
. - Parameters:
concerns
- The concerns to register.- See Also:
-
registerConcerns
Registers the given concerns, associating them with their respective concern types.- Implementation Specification:
- The default implementation delegates to
registerConcerns(Stream)
. - Parameters:
concerns
- The concerns to register.- See Also:
-
registerConcerns
Registers the given concerns, associating them with their respective concern types.- Implementation Specification:
- The default implementation calls
registerConcern(Concern)
for each indicated concern. - Parameters:
concerns
- The concerns to register.- See Also:
-
registerConcern
Registers the given concern, associating it with its concern type.- Implementation Specification:
- The default implementation delegates to
registerConcern(Class, Concern)
. - Type Parameters:
C
- The type of concern being registered.D
- The type of concern previously registered.- Parameters:
concern
- The concern to register.- Returns:
- The concern previously associated with the same concern type.
- Throws:
NullPointerException
- if the given concern isnull
.ClassCastException
- if the concern to be registered is not an instance of its ownConcern.getConcernType()
.- See Also:
-
registerConcern
<T extends Concern,C extends T> Optional<T> registerConcern(@Nonnull Class<T> concernType, @Nonnull C concern) Registers the given concern.- Type Parameters:
T
- The registration concern type.C
- The type of concern being registered.- Parameters:
concernType
- The class with which to associate the concern.concern
- The concern to register.- Returns:
- The concern previously associated with the given class.
- Throws:
NullPointerException
- if the given concern isnull
.ClassCastException
- if the concern to be registered is not an instance of the given concern type.
-
unregisterConcern
Unregisters a concern of the given type. If no concern is associated with the specified type, no action occurs.- Type Parameters:
T
- The type of concern being unregistered.- Parameters:
concernType
- The class with which the concern is associated.- Returns:
- The concern previously associated with the given class.
-