Builder Class — spring-boot Architecture
Architecture documentation for the Builder class in SpringProfileArbiter.java from the spring-boot codebase.
Entity Profile
Source Code
core/spring-boot/src/main/java/org/springframework/boot/logging/log4j2/SpringProfileArbiter.java lines 68–116
static final class Builder implements org.apache.logging.log4j.core.util.Builder<SpringProfileArbiter> {
private static final Logger statusLogger = StatusLogger.getLogger();
@PluginBuilderAttribute
@SuppressWarnings("NullAway.Init")
private String name;
@PluginConfiguration
@SuppressWarnings("NullAway.Init")
private Configuration configuration;
@PluginLoggerContext
@SuppressWarnings("NullAway.Init")
private LoggerContext loggerContext;
private Builder() {
}
/**
* Sets the profile name or expression.
* @param name the profile name or expression
* @return this
* @see Profiles#of(String...)
*/
public Builder setName(String name) {
this.name = name;
return this;
}
@Override
public SpringProfileArbiter build() {
Environment environment = Log4J2LoggingSystem.getEnvironment(this.loggerContext);
if (environment == null) {
statusLogger.debug("Creating Arbiter without a Spring Environment");
}
String name = this.configuration.getStrSubstitutor().replace(this.name);
String[] profiles = trimArrayElements(StringUtils.commaDelimitedListToStringArray(name));
return new SpringProfileArbiter(environment, profiles);
}
// The array has no nulls in it, but StringUtils.trimArrayElements return
// @Nullable String[]
@SuppressWarnings("NullAway")
private String[] trimArrayElements(String[] array) {
return StringUtils.trimArrayElements(array);
}
}
Source
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free