/
NikolayIvkin
/
tutorials1
Обзор
Документация
Войти
/
NikolayIvkin
/
tutorials1
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
spring-boot-modules/spring-boot-annotations/src/main/java/com/baeldung/annotations/Car.java
30 строк
626 B
dupirefr
* Moved annotations articles to new spring-boot-annotations module
17 фев 2020, 09:25
17 фев 2020, 09:25
6cd76fb
Код
Авторство
О чём код?
package com.baeldung.annotations; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.DependsOn; import org.springframework.context.annotation.Primary; import org.springframework.stereotype.Component; @Component @Primary @DependsOn("engine") public class Car implements Vehicle { @Autowired private Engine engine; @Autowired public Car(Engine engine) { this.engine = engine; } @Autowired public void setEngine(Engine engine) { this.engine = engine; } public Engine getEngine() { return engine; } }