Skip to content

Instantly share code, notes, and snippets.

@sidneydemoraes
Created April 27, 2017 19:25
Show Gist options
  • Save sidneydemoraes/8c95a6ef7d3420e8f6039a8538192f85 to your computer and use it in GitHub Desktop.
Save sidneydemoraes/8c95a6ef7d3420e8f6039a8538192f85 to your computer and use it in GitHub Desktop.
TechTalk - Gradle + Spring Boot + Groovy - ConfigProperties.groovy
import org.springframework.beans.factory.annotation.Value
import org.springframework.context.annotation.Configuration
@Configuration
class ConfigProperties {
@Value('${busca.parametro}')
Double raioEmKm;
@Value('${email.contato}')
String nossoEmail
@Value('${paypal.clientId}')
String paypalClientId
@Value('${paypal.clientSecret}')
String paypalClientSecret
@Value('${paypal.environment}')
String paypalEnvironment
double getRaioEmKm() {
return raioEmKm > 0 ? raioEmKm : 0.5;
}
@Deprecated
void setRaioEmKm(Double raioEmKm) {
this.raioEmKm = raioEmKm
}
@Deprecated
void setNossoEmail(String nossoEmail) {
this.nossoEmail = nossoEmail
}
@Deprecated
void setPaypalClientId(String paypalClientId) {
this.paypalClientId = paypalClientId
}
@Deprecated
void setPaypalClientSecret(String paypalClientSecret) {
this.paypalClientSecret = paypalClientSecret
}
@Deprecated
void setPaypalEnvironment(String paypalEnvironment) {
this.paypalEnvironment = paypalEnvironment
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment