Skip to content

Latest commit

 

History

History
27 lines (20 loc) · 870 Bytes

README.md

File metadata and controls

27 lines (20 loc) · 870 Bytes

lombok-spring-qualifier

Small project demonstrating that the constructor injection of @Qualifier beans is now possible with lombok

Check out the test folder where there is a service wired like that:

@Service
@Getter
@RequiredArgsConstructor
public class LombokInjectorTestService {
	@Qualifier(DESTINATION_ONE) @NonNull private final Destination destination1;
	@Qualifier(DESTINATION_TWO) @NonNull private final Destination destination2;
}

NOTE: Keep in mind that this functionality was introduced in lombok 1.18.4 and it requires placing a lombok.config file in the root of your dir, looking like that:

# Copy the Qualifier annotation from the instance variables to the constructor
# see https://github.com/rzwitserloot/lombok/issues/745
lombok.copyableAnnotations += org.springframework.beans.factory.annotation.Qualifier