private RetryMode resolveRetryMode() {
        RetryMode mode = envVar();

        if (mode != null) {
            return mode;
        }

        mode = systemProperty();
        if (mode != null) {
            return mode;
        }

        mode = profile();
        if (mode != null) {
            return mode;
        }
        
        mode = internalDefault();
        if (mode != null) {
            return mode;
        }
        
        return SDK_DEFAULT_RETRY_MODE;
    }
@return the resolved retry mode. If not found, {@link RetryMode#LEGACY} will be returned
aws-java-sdk-core/src/main/java/com/amazonaws/retry/internal/RetryModeResolver.java