Class DurationOptionHandler

java.lang.Object
org.kohsuke.args4j.spi.OptionHandler<Duration>
org.jenkinsci.remoting.DurationOptionHandler

@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public class DurationOptionHandler extends org.kohsuke.args4j.spi.OptionHandler<Duration>
Parses a string like 1s, 2m, 3h, 4d into a Duration.
  • Constructor Details

    • DurationOptionHandler

      public DurationOptionHandler(org.kohsuke.args4j.CmdLineParser parser, org.kohsuke.args4j.OptionDef option, org.kohsuke.args4j.spi.Setter<? super Duration> setter)
  • Method Details

    • parseArguments

      public int parseArguments(org.kohsuke.args4j.spi.Parameters params) throws org.kohsuke.args4j.CmdLineException
      Specified by:
      parseArguments in class org.kohsuke.args4j.spi.OptionHandler<Duration>
      Throws:
      org.kohsuke.args4j.CmdLineException
    • getDefaultMetaVariable

      public String getDefaultMetaVariable()
      Specified by:
      getDefaultMetaVariable in class org.kohsuke.args4j.spi.OptionHandler<Duration>
    • print

      protected String print(Duration v)
      Overrides:
      print in class org.kohsuke.args4j.spi.OptionHandler<Duration>