public static Transcoder newTranscoder(final BaseMemcachedProperties memcachedProperties,
                                           final Collection<Class> kryoSerializableClasses) {
        switch (memcachedProperties.getTranscoder()) {
            case SERIAL -> {
                val serial = new SerializingTranscoder();
                serial.setCompressionThreshold(memcachedProperties.getTranscoderCompressionThreshold());
                LOGGER.debug("Creating memcached transcoder [{}]", serial.getClass().getName());
                return serial;
            }
            case WHALIN -> {
                val whalin = new WhalinTranscoder();
                whalin.setCompressionThreshold(memcachedProperties.getTranscoderCompressionThreshold());
                LOGGER.debug("Creating memcached transcoder [{}]", whalin.getClass().getName());
                return whalin;
            }
            case WHALINV1 -> {
                val whalinv1 = new WhalinV1Transcoder();
                whalinv1.setCompressionThreshold(memcachedProperties.getTranscoderCompressionThreshold());
                LOGGER.debug("Creating memcached transcoder [{}]", whalinv1.getClass().getName());
                return whalinv1;
            }
            default -> {
                val kryoPool = new CasKryoPool(kryoSerializableClasses, true,
                    memcachedProperties.isKryoRegistrationRequired(),
                    memcachedProperties.isKryoObjectsByReference(),
                    memcachedProperties.isKryoAutoReset());
                val kryo = new CasKryoTranscoder(kryoPool);
                LOGGER.debug("Creating memcached transcoder [{}]", kryo.getClass().getName());
                return kryo;
            }
        }
    }
New transcoder transcoder.

@param memcachedProperties     the memcached properties
@param kryoSerializableClasses the kryo serializable classes
@return the transcoder
support/cas-server-support-memcached-core/src/main/java/org/apereo/cas/memcached/MemcachedUtils.java