use of org.springframework.boot.autoconfigure.condition.ConditionMessage in project spring-boot by spring-projects.
the class OnEnabledEndpointCondition method determineEndpointOutcome.
private ConditionOutcome determineEndpointOutcome(String endpointName, boolean enabledByDefault, ConditionContext context) {
RelaxedPropertyResolver resolver = new RelaxedPropertyResolver(context.getEnvironment(), "endpoints." + endpointName + ".");
if (resolver.containsProperty("enabled") || !enabledByDefault) {
boolean match = resolver.getProperty("enabled", Boolean.class, enabledByDefault);
ConditionMessage message = ConditionMessage.forCondition(ConditionalOnEnabledEndpoint.class, "(" + endpointName + ")").because(match ? "enabled" : "disabled");
return new ConditionOutcome(match, message);
}
return null;
}
use of org.springframework.boot.autoconfigure.condition.ConditionMessage in project spring-boot by spring-projects.
the class OnEnabledEndpointCondition method determineAllEndpointsOutcome.
private ConditionOutcome determineAllEndpointsOutcome(ConditionContext context) {
RelaxedPropertyResolver resolver = new RelaxedPropertyResolver(context.getEnvironment(), "endpoints.");
boolean match = Boolean.valueOf(resolver.getProperty("enabled", "true"));
ConditionMessage message = ConditionMessage.forCondition(ConditionalOnEnabledEndpoint.class).because("All endpoints are " + (match ? "enabled" : "disabled") + " by default");
return new ConditionOutcome(match, message);
}
Aggregations