首页>代码>Spring Boot配置@Profile注解加载不同环境的配置文件实例>/profiles/src/main/java/com/memorynotfound/springboot/ApplicationProperties.java
package com.memorynotfound.springboot; import org.springframework.boot.context.properties.ConfigurationProperties; @ConfigurationProperties("app") public class ApplicationProperties { private String name; private String email; public String getName() { return name; } public void setName(String name) { this.name = name; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } @Override public String toString() { return "ApplicationProperties{" + "name='" + name + '\'' + ", email='" + email + '\'' + '}'; } }