I have a spring @configuration annotated class MappingsClientConfig with a boolean field as:
@Value(\"${mappings.enabled:true}\")
private boolean mappi
Its an old thread but if you still want to inject Non-String values using @Value Spring annotation, do this:
@Value("#{new Boolean('${item.priceFactor}')}")
private Boolean itemFactorBoolean;
@Value("#{new Integer('${item.priceFactor}')}")
private Integer itemFactorInteger;
Works for me on Spring boot 1.5.9 with Java 8.