private long toSeconds() {
        switch (type) {
            case SECONDS:
                return value;
            case MINUTES:
                return value * 60;
            case HOURS:
                return value * 3600;
            case DAYS:
                return value * 24 * 3600;
            case MILLISECONDS:
            default:
                return value / 1000;
        }
    }