Last active
August 27, 2020 04:41
-
-
Save elegantcoder/c1586fdbe8db9689d8597a9c13c95fc8 to your computer and use it in GitHub Desktop.
[PojoFactoryWithDI] #java #spring
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.springframework.stereotype.Component; | |
import lombok.RequiredArgsConstructor; | |
@Component | |
@RequiredArgsConstructor | |
class AFactory { | |
private final AComponent aComponent; | |
private final BComponent bComponent; | |
public APowered createInstance(AEntity aEntity) { | |
return new APowered(aEntity, aComponent, bComponent); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello Spring, DI, Java World.