private static <T extends TBase<T, F>, F extends TFieldIdEnum> MethodInfo newMethodInfo(
            String serviceName, String name,
            Class<? extends TBase<?, ?>> argsClass,
            @Nullable Class<? extends TBase<?, ?>> resultClass,
            Class<? extends TException>[] exceptionClasses,
            Iterable<EndpointInfo> endpoints) {
        requireNonNull(serviceName, "serviceName");
        requireNonNull(name, "name");
        requireNonNull(argsClass, "argsClass");
        requireNonNull(exceptionClasses, "exceptionClasses");
        requireNonNull(endpoints, "endpoints");

        final List<FieldInfo> parameters =
                ThriftMetadataAccess.getStructMetaDataMap(argsClass).values().stream()
                                    .map(fieldMetaData -> newFieldInfo(argsClass, fieldMetaData))
                                    .collect(toImmutableList());

        // Find the 'success' field.
        FieldInfo fieldInfo = null;
        if (resultClass != null) { // Function isn't "oneway" function
            final Map<?, FieldMetaData> resultMetaData =
                    ThriftMetadataAccess.getStructMetaDataMap(resultClass);

            for (FieldMetaData fieldMetaData : resultMetaData.values()) {
                if ("success".equals(fieldMetaData.fieldName)) {
                    fieldInfo = newFieldInfo(resultClass, fieldMetaData);
                    break;
                }
            }
        }

        final TypeSignature returnTypeSignature;
        if (fieldInfo == null) {
            returnTypeSignature = VOID;
        } else {
            returnTypeSignature = fieldInfo.typeSignature();
        }

        final List<TypeSignature> exceptionTypeSignatures =
                Arrays.stream(exceptionClasses)
                      .filter(e -> e != TException.class)
                      .map(TypeSignature::ofStruct)
                      .collect(toImmutableList());

        return new MethodInfo(serviceName, name, returnTypeSignature, parameters, false,
                              exceptionTypeSignatures,
                              endpoints,
                              ImmutableList.of(),
                              ImmutableList.of(),
                              ImmutableList.of(),
                              ImmutableList.of(), HttpMethod.POST, DescriptionInfo.empty());
    }
{@link DocServicePlugin} implementation that supports {@link THttpService}s.
thrift/thrift0.13/src/main/java/com/linecorp/armeria/internal/server/thrift/ThriftDocServicePlugin.java