package com.qmth.boot.mybatis.config;

import org.hibernate.validator.constraints.time.DurationMin;
import org.springframework.validation.annotation.Validated;

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

@Validated
public class ProfilerProperties {

    private boolean enable = false;

    @NotNull
    @DurationMin(millis = 0)
    private Duration threshold = Duration.ofMillis(0);

    public boolean isEnable() {
        return enable;
    }

    public void setEnable(boolean enable) {
        this.enable = enable;
    }

    public Duration getThreshold() {
        return threshold;
    }

    public void setThreshold(Duration threshold) {
        this.threshold = threshold;
    }
}
