private static TypeSignature toTypeSignature(Type type) {
        if (type instanceof ParameterizedType) {
            final ParameterizedType parameterizedType = (ParameterizedType) type;
            final Class<?> rawType = (Class<?>) parameterizedType.getRawType();
            if (List.class.isAssignableFrom(rawType)) {
                return TypeSignature.ofList(toTypeSignature(parameterizedType.getActualTypeArguments()[0]));
            }
            if (Set.class.isAssignableFrom(rawType)) {
                return TypeSignature.ofSet(toTypeSignature(parameterizedType.getActualTypeArguments()[0]));
            }

            if (Map.class.isAssignableFrom(rawType)) {
                final TypeSignature key = toTypeSignature(parameterizedType.getActualTypeArguments()[0]);
                final TypeSignature value = toTypeSignature(parameterizedType.getActualTypeArguments()[1]);
                return TypeSignature.ofMap(key, value);
            }
        }

        if (type == Void.class || type == void.class) {
            return VOID;
        }
        if (type == Boolean.class || type == boolean.class) {
            return BOOL;
        }
        if (type == Byte.class || type == byte.class) {
            return I8;
        }
        if (type == Short.class || type == short.class) {
            return I16;
        }
        if (type == Integer.class || type == int.class) {
            return I32;
        }
        if (type == Long.class || type == long.class) {
            return I64;
        }
        if (type == Double.class || type == double.class) {
            return DOUBLE;
        }
        if (type == String.class) {
            return STRING;
        }
        if (type == ByteBuffer.class) {
            return BINARY;
        }

        if (!(type instanceof Class)) {
            return TypeSignature.ofBase(type.getTypeName());
        }

        final Class<?> type1 = (Class<?>) type;
        if (type1.isEnum()) {
            return TypeSignature.ofEnum(type1);
        }
        return TypeSignature.ofStruct(type1);
    }
A {@link DescriptiveTypeInfoProvider} to create a {@link DescriptiveTypeInfo} from a Thrift type
such as {@link TBase} {@link TEnum} or {@link TException}.
thrift/thrift0.13/src/main/java/com/linecorp/armeria/internal/server/thrift/ThriftDescriptiveTypeInfoProvider.java