org.zodiac.autoconfigure.application.ApplicationInfoProperties Maven / Gradle / Ivy
package org.zodiac.autoconfigure.application;
import java.util.Objects;
import org.springframework.context.EnvironmentAware;
import org.springframework.core.env.Environment;
import org.springframework.core.env.EnvironmentCapable;
import org.zodiac.core.application.ApplicationInfo;
public class ApplicationInfoProperties extends ApplicationInfo implements EnvironmentAware, EnvironmentCapable {
private static final long serialVersionUID = -8790406955169903425L;
public static final ApplicationInfoProperties ME = new ApplicationInfoProperties();
private Environment environment;
private ApplicationInfoProperties() {
super();
}
@Override
public Environment getEnvironment() {
Objects.requireNonNull(environment, "Spring boot 环境下 Environment 不可能为null");
return environment;
}
@Override
public void setEnvironment(Environment environment) {
this.environment = environment;
}
@Override
public String getName() {
Objects.requireNonNull(environment, "Spring boot 环境下 Environment 不可能为null");
return super.getName();
}
}