src/main/java/com/linecorp/armeria/server/thrift/ThriftService.java
/**
     * Creates a new instance with the specified service implementation and supporting the protocols specified
     * in {@code allowedSerializationFormats} and defaulting to the specified {@code defaultSerializationFormat}
     * when the client doesn't specify one. Currently, the only way to specify a serialization format is by
     * using the HTTP session protocol and setting the Content-Type header to the appropriate
     * {@link SerializationFormat#mimeType}.
     *
     * @param thriftService an implementation of {@code *.Iface} or {@code *.AsyncIface} service interface
     *                      generated by the  Apache Thrift compiler
     * @param defaultSerializationFormat the default serialization format to use when not specified by the
     *                                   client
     * @param otherAllowedSerializationFormats other serialization formats that should be supported by this
     *                                         service in addition to the default
     */
Creates a new instance with the specified service implementation and supporting the protocols specified
in  allowedSerializationFormats and defaulting to the specified  defaultSerializationFormat
when the client doesn't specify one. Currently, the only way to specify a serialization format is by
using the HTTP session protocol and setting the Content-Type header to the appropriate
SerializationFormat#mimeType.

@param thriftService an implementation of  *.Iface or  *.AsyncIface service interface
generated by the  Apache Thrift compiler
@param defaultSerializationFormat the default serialization format to use when not specified by the
client
@param otherAllowedSerializationFormats other serialization formats that should be supported by this
service in addition to the default
Creates a new instance with the specified service implementation and supporting the protocols specified in allowedSerializationFormats and defaulting to the specified defaultSerializationFormat when the client doesn ' t specify one . Currently the only way to specify a serialization format is by using the HTTP session protocol and setting the Content - Type header to the appropriate SerializationFormat#mimeType . @param thriftService an implementation of * . Iface or * . AsyncIface service interface generated by the Apache Thrift compiler @param defaultSerializationFormat the default serialization format to use when not specified by the client @param otherAllowedSerializationFormats other serialization formats that should be supported by this service in addition to the default
public static ThriftService ofFormats(Object thriftService, SerializationFormat defaultSerializationFormat,
                                          Iterable<SerializationFormat> otherAllowedSerializationFormats) {
        requireNonNull(otherAllowedSerializationFormats, "otherAllowedSerializationFormats");
        EnumSet<SerializationFormat> allowedSerializationFormatsSet = EnumSet.of(defaultSerializationFormat);
        otherAllowedSerializationFormats.forEach(allowedSerializationFormatsSet::add);
        return new ThriftService(
                new ThriftServiceCodec(
                        thriftService,
                        defaultSerializationFormat,
                        allowedSerializationFormatsSet),
                new ThriftServiceInvocationHandler(thriftService));
    }
public static ThriftService ofFormats ( Object thriftService , SerializationFormat defaultSerializationFormat , Iterable < SerializationFormat > otherAllowedSerializationFormats ) { requireNonNull ( otherAllowedSerializationFormats , "otherAllowedSerializationFormats" ) ; EnumSet < SerializationFormat > allowedSerializationFormatsSet = EnumSet . of ( defaultSerializationFormat ) ; otherAllowedSerializationFormats . forEach ( allowedSerializationFormatsSet :: add ) ; return new ThriftService ( new ThriftServiceCodec ( thriftService , defaultSerializationFormat , allowedSerializationFormatsSet ) , new ThriftServiceInvocationHandler ( thriftService ) ) ; }
Creates a new instance with the specified service implementation and supporting the protocols specified
 in {@code allowedSerializationFormats} and defaulting to the specified {@code defaultSerializationFormat}
 when the client doesn't specify one.
Creates a new instance with the specified service implementation and supporting the protocols specified in { @code allowedSerializationFormats } and defaulting to the specified { @code defaultSerializationFormat } when the client doesn ' t specify one .