All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.zodiac.autoconfigure.application.ApplicationInfoProperties Maven / Gradle / Ivy

There is a newer version: 1.6.8
Show newest version
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();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy