@Override
    public String compact(final StringBuilder builder, final Ticket ticket) throws Exception {
        val code = (OAuth20Code) ticket;
        builder.append(String.format("%s%s", DELIMITER, code.getService().getShortenedId()));
        builder.append(String.format("%s%s", DELIMITER, code.getClientId()));
        builder.append(String.format("%s%s", DELIMITER, String.join("|", code.getScopes())));
        builder.append(String.format("%s%s", DELIMITER, StringUtils.defaultString(code.getCodeChallenge())));
        builder.append(String.format("%s%s", DELIMITER, StringUtils.defaultString(code.getCodeChallengeMethod())));
        builder.append(String.format("%s%s", DELIMITER, code.getResponseType() != null ? code.getResponseType().ordinal() : OAuth20ResponseTypes.CODE.ordinal()));
        builder.append(String.format("%s%s", DELIMITER, code.getGrantType() != null ? code.getGrantType().ordinal() : OAuth20GrantTypes.AUTHORIZATION_CODE.ordinal()));
        builder.append(compactAuthenticationAttempt(code).toString());
        return builder.toString();
    }
This is {@link OAuth20CodeCompactor}.

@author Misagh Moayyed
@since 7.1.0
support/cas-server-support-oauth-core-api/src/main/java/org/apereo/cas/ticket/code/OAuth20CodeCompactor.java