@Override
    public ConditionOutcome getMatchOutcome(final ConditionContext context, final AnnotatedTypeMetadata metadata) {
        val name = metadata.getAnnotationAttributes(ConditionalOnMatchingHostname.class.getName()).get("name").toString();
        val hostnameToMatch = context.getEnvironment().getProperty(name);
        if (StringUtils.isBlank(hostnameToMatch)) {
            return ConditionOutcome.match("No hostname set with property: " + name);
        }
        if (RegexUtils.find(hostnameToMatch, InetAddressUtils.getCasServerHostName())) {
            return ConditionOutcome.match("Hostname matches value for " + name);
        }
        return ConditionOutcome.noMatch("Hostname doesn't match value for " + name);
    }
This is {@link MatchingHostnameCondition}.

@author Hal Deadman
@since 6.4.0
core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/spring/boot/MatchingHostnameCondition.java