Spring annotations article (#4232)

* Spring annotations

* commented VehicleFactoryApplication to fix CI build
This commit is contained in:
fanatixan
2018-05-12 22:43:12 +02:00
committed by maibin
parent 5c4fe46ea2
commit 506962bc96
16 changed files with 301 additions and 0 deletions
@@ -0,0 +1,26 @@
package com.baeldung.annotations;
import org.springframework.beans.factory.annotation.Value;
public class Engine {
@Value("8")
private int cylinderCount;
@Value("${engine.fuelType}")
private String fuelType;
public Engine() {
this(8);
}
public Engine(@Value("8") int cylinderCount) {
this.cylinderCount = cylinderCount;
}
@Value("8")
public void setCylinderCount(int cylinderCount) {
this.cylinderCount = cylinderCount;
}
}