package com.qmth.boot.core.retrofit.config;

import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.NotNull;
import java.time.Duration;

@Validated
public class PoolProperties {

    @NotNull
    private Integer maxIdle = 1;

    @NotNull
    private Duration keepAlive = Duration.ofMinutes(10);

    public Integer getMaxIdle() {
        return maxIdle;
    }

    public void setMaxIdle(Integer maxIdle) {
        this.maxIdle = maxIdle;
    }

    public Duration getKeepAlive() {
        return keepAlive;
    }

    public void setKeepAlive(Duration keepAlive) {
        this.keepAlive = keepAlive;
    }
}
