it.jnrpe.plugins
Class PluginOption

java.lang.Object
  extended by it.jnrpe.plugins.PluginOption

public final class PluginOption
extends Object

This class describes a plugin option.

Author:
Massimiliano Ziccardi

Constructor Summary
PluginOption()
          Default constructor.
 
Method Summary
 String getArgName()
          Returns the name of the argument of this option.
 Integer getArgsCount()
          Returns the number of arguments.
 Boolean getArgsOptional()
          Used to know if the option has optional arguments.
 String getDescription()
          Returns the description of this option.
 String getLongOpt()
          Returns the long name of this option.
 String getOption()
          Returns the option string.
 String getRequired()
          Returns the string 'true' if required.
 String getType()
          Returns the type of this option.
 String getValueSeparator()
          Returns the value separator.
 boolean hasArgs()
          Returns true if the option has an argument.
 PluginOption setArgName(String argumentName)
          Sets the name of the argument of this option.
 PluginOption setArgsCount(Integer numberOfArgs)
          Sets the number of arguments.
 PluginOption setArgsOptional(Boolean argsOptional)
          Sets if the arguments are mandatory.
 PluginOption setDescription(String optDescription)
          Sets the description of this option.
 PluginOption setHasArgs(boolean argsPresent)
          Tells the option that it must accept an argument.
 PluginOption setLongOpt(String longOptName)
          Sets the long name of this option.
 PluginOption setOption(String optionName)
          Sets the option string.
 PluginOption setRequired(boolean optIsRequired)
          Set if the option is required.
 PluginOption setType(String type)
          Sets the type of this option.
 PluginOption setValueSeparator(String argumentsValueSeparator)
          Sets the value separator.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PluginOption

public PluginOption()
Default constructor.

Method Detail

getOption

public String getOption()
Returns the option string.

Returns:
The option as string

setOption

public PluginOption setOption(String optionName)
Sets the option string. For example, if the plugin must receive the. '--file' option, sOption will be 'file'.

Parameters:
optionName - The option as string
Returns:
this

hasArgs

public boolean hasArgs()
Returns true if the option has an argument.

Returns:
true if the option has an argument.

setHasArgs

public PluginOption setHasArgs(boolean argsPresent)
Tells the option that it must accept an argument.

Parameters:
argsPresent - true if the option has an argument.
Returns:
this

getArgsCount

public Integer getArgsCount()
Returns the number of arguments.

Returns:
the number of arguments.

setArgsCount

public PluginOption setArgsCount(Integer numberOfArgs)
Sets the number of arguments.

Parameters:
numberOfArgs - the number of arguments.
Returns:
this

getRequired

public String getRequired()
Returns the string 'true' if required.

Returns:
the string 'true' if required.

setRequired

public PluginOption setRequired(boolean optIsRequired)
Set if the option is required.

Parameters:
optIsRequired - true if the option is required.
Returns:
this

getArgsOptional

public Boolean getArgsOptional()
Used to know if the option has optional arguments.

Returns:
true if the option has optional arguments.

setArgsOptional

public PluginOption setArgsOptional(Boolean argsOptional)
Sets if the arguments are mandatory.

Parameters:
argsOptional - true if the option has optional arguments.
Returns:
this

getArgName

public String getArgName()
Returns the name of the argument of this option.

Returns:
the name of the argument of this option.

setArgName

public PluginOption setArgName(String argumentName)
Sets the name of the argument of this option.

Parameters:
argumentName - The argument name
Returns:
this

getLongOpt

public String getLongOpt()
Returns the long name of this option.

Returns:
the long name of this option.

setLongOpt

public PluginOption setLongOpt(String longOptName)
Sets the long name of this option.

Parameters:
longOptName - the long name of this option.
Returns:
this

getType

public String getType()
Returns the type of this option.

Returns:
the type of this option.

setType

public PluginOption setType(String type)
Sets the type of this option.

Parameters:
type - the type of this option.
Returns:
this

getValueSeparator

public String getValueSeparator()
Returns the value separator.

Returns:
the value separator.

setValueSeparator

public PluginOption setValueSeparator(String argumentsValueSeparator)
Sets the value separator.

Parameters:
argumentsValueSeparator - the value separator.
Returns:
this

getDescription

public String getDescription()
Returns the description of this option.

Returns:
the description of this option.

setDescription

public PluginOption setDescription(String optDescription)
Sets the description of this option.

Parameters:
optDescription - the description of this option.
Returns:
this


Copyright © 2014. All Rights Reserved.