@Deprecated
    public static SerializationFormat toSerializationFormat(TProtocolFactory protoFactory) {
        requireNonNull(protoFactory, "protoFactory");
        if (protoFactory instanceof TBinaryProtocol.Factory) {
            return ThriftSerializationFormats.BINARY;
        } else if (protoFactory instanceof TCompactProtocol.Factory) {
            return ThriftSerializationFormats.COMPACT;
        } else if (protoFactory instanceof TJSONProtocol.Factory) {
            return ThriftSerializationFormats.JSON;
        } else if (protoFactory instanceof TTextProtocolFactory) {
            final TTextProtocolFactory factory = (TTextProtocolFactory) protoFactory;
            return factory.usesNamedEnums() ? ThriftSerializationFormats.TEXT_NAMED_ENUM
                                            : ThriftSerializationFormats.TEXT;
        } else {
            throw new IllegalArgumentException(
                    "unsupported TProtocolFactory: " + protoFactory.getClass().getName());
        }
    }
Returns the {@link SerializationFormat} for the specified {@link TProtocolFactory},
as if it were registered by {@link DefaultThriftProtocolFactoryProvider}.
Consider having your own {@link TProtocolFactory} to {@link SerializationFormat} mapping if
necessary.

@throws IllegalArgumentException if the specified {@link TProtocolFactory} did not match anything
@deprecated This method has been deprecated without a replacement since it cannot reliably work
            with custom protocol factories.
thrift/thrift0.13/src/main/java/com/linecorp/armeria/common/thrift/ThriftProtocolFactories.java