UseCase class

UseCase layer annotation - indicates application use case components

This annotation is a specialization of @Component for classes that contain specific business use cases or application logic, following Clean Architecture principles.

Use cases encapsulate application-specific business rules and orchestrate the flow of data to and from entities and repositories.

Example:

@UseCase()
class GetUserUseCase {
  @Autowired()
  late UserRepository userRepository;

  Future<User?> execute(String userId) async {
    return await userRepository.findById(userId);
  }
}
Inheritance

Constructors

UseCase([String? value])
Creates a UseCase annotation
const

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value String?
Optional value to specify the component name
finalinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited