* Moved annotations articles to new spring-boot-annotations module

This commit is contained in:
dupirefr
2020-02-13 18:23:27 +01:00
parent 577596a503
commit d4c4ec95c6
18 changed files with 17 additions and 1 deletions

View File

@@ -0,0 +1,30 @@
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;
}
}