All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.codegen.rules2.RuleResult.resource Maven / Gradle / Ivy

Go to download

The AWS SDK for Java - Code Generator module holds the classes and templates required to generate the AWS Java SDK clients for AWS services.

The newest version!
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.endpoints.Endpoint;
import software.amazon.awssdk.utils.Validate;

@SdkInternalApi
public final class RuleResult {
    private static final RuleResult CARRY_ON = new RuleResult();
    private final String error;
    private final Endpoint endpoint;

    private RuleResult() {
        this.error = null;
        this.endpoint = null;
    }

    private RuleResult(String error) {
        this.error = Validate.paramNotNull(error, "error");
        this.endpoint = null;
    }

    private RuleResult(Endpoint endpoint) {
        this.error = null;
        this.endpoint = Validate.paramNotNull(endpoint, "endpoint");
    }

    public boolean canContinue() {
        return error == null && endpoint == null;
    }

    public boolean isResolved() {
        return !isUnresolved();
    }

    public boolean isUnresolved() {
        return error == null && endpoint == null;
    }

    public boolean isError() {
        return error != null;
    }

    public boolean isEndpoint() {
        return endpoint != null;
    }

    public String error() {
        return error;
    }

    public Endpoint endpoint() {
        return endpoint;
    }

    public static RuleResult error(String error) {
        return new RuleResult(error);
    }

    public static RuleResult carryOn() {
        return CARRY_ON;
    }

    public static RuleResult endpoint(Endpoint endpoint) {
        return new RuleResult(endpoint);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy