aliyun / alibabacloud-java-async-sdk

16 stars 26 forks source link

如果把Request的内部Builder改为public ,而非protected,能够提供更多的Request构建灵活性 #10

Closed iridescentGray closed 1 week ago

iridescentGray commented 10 months ago

SDK代码如下

目前是 protected

package com.aliyun.sdk.gateway.pop.models;

import darabonba.core.RequestModel;

public abstract class Request extends RequestModel {
    protected Request(Builder<?, ?> builder) {
        super(builder);
    }

    public abstract Builder toBuilder();

    protected abstract static class Builder<ProviderT extends Request, BuilderT extends Builder> extends RequestModel.BuilderImpl<ProviderT, BuilderT> {
        protected Builder() {
        }

        protected Builder(Request request) {
        }
    }
}

参考隔壁AWS EC2 SDK software.amazon.awssdk.awscore.AwsRequest

更容易操作

   public interface Builder extends SdkRequest.Builder {
        AwsRequestOverrideConfiguration overrideConfiguration();

        Builder overrideConfiguration(AwsRequestOverrideConfiguration var1);

        Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> var1);

        AwsRequest build();
    }
yangwei980131 commented 6 months ago

I think so