/*
 * Copyright 2017 The RoboZonky Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.github.robozonky.app.configuration;

import java.time.Duration;

import com.beust.jcommander.Parameter;
import org.slf4j.LoggerFactory;

class MarketplaceCommandLineFragment extends AbstractCommandLineFragment {

    private static final int DEFAULT_DURATION = 60;

    @Parameter(names = {"-z", "--zonk"}, hidden = true,
            description = "The longest amount of time in minutes for which Zonky is allowed to sleep.")
    private int maximumSleepDuration = DEFAULT_DURATION;

    @Parameter(names = {"-w", "--wait-primary", "--wait"},
            description = "Number of seconds between consecutive checks of primary marketplace.")
    private int primaryMarketplaceCheckDelay = 10;

    @Parameter(names = {"-ws", "--wait-secondary"},
            description = "Number of seconds between consecutive checks of secondary marketplace.")
    private int secondaryMarketplaceCheckDelay = primaryMarketplaceCheckDelay;

    public Duration getPrimaryMarketplaceCheckDelay() {
        return Duration.ofSeconds(primaryMarketplaceCheckDelay);
    }

    public Duration getSecondaryMarketplaceCheckDelay() {
        return Duration.ofSeconds(secondaryMarketplaceCheckDelay);
    }

    @Deprecated
    public Duration getMaximumSleepDuration() {
        if (maximumSleepDuration != DEFAULT_DURATION) {
            LoggerFactory.getLogger(MarketplaceCommandLineFragment.class)
                    .info("Setting sleep duration no longer has any effect. Please stop using the '-z' command line " +
                                  "switch, which will be removed in future versions of RoboZonky.");
        }
        return Duration.ofMinutes(maximumSleepDuration);
    }
}

@@ -718,40 +718,8 @@
 ter;
-%0Aimport org.slf4j.LoggerFactory;
 %0A%0Acl
@@ -796,279 +796,8 @@
  %7B%0A%0A
-    private static final int DEFAULT_DURATION = 60;%0A%0A    @Parameter(names = %7B%22-z%22, %22--zonk%22%7D, hidden = true,%0A            description = %22The longest amount of time in minutes for which Zonky is allowed to sleep.%22)%0A    private int maximumSleepDuration = DEFAULT_DURATION;%0A%0A
     
@@ -1497,494 +1497,6 @@
  %7D%0A%0A
-    @Deprecated%0A    public Duration getMaximumSleepDuration() %7B%0A        if (maximumSleepDuration != DEFAULT_DURATION) %7B%0A            LoggerFactory.getLogger(MarketplaceCommandLineFragment.class)%0A                    .info(%22Setting sleep duration no longer has any effect. Please stop using the '-z' command line %22 +%0A                                  %22switch, which will be removed in future versions of RoboZonky.%22);%0A        %7D%0A        return Duration.ofMinutes(maximumSleepDuration);%0A    %7D%0A
 %7D%0A

Remove the deprecated "-z" command line option