| java.lang.Object pygmy.core.ConfigOption
ConfigOption | public class ConfigOption (Code) | | This class is used by handlers or endpoints to tell the server which options are
used to configure the object.
|
Constructor Summary | |
public | ConfigOption(String propertyName, String helpString) This is used to create an optional property that defaults to null if unspecified. | public | ConfigOption(String propertyName, String defaultValue, String helpString) This is used to create an optional property that has a supplied default value. | public | ConfigOption(String propertyName, boolean required, String helpString) This is used to create a required property. |
Method Summary | |
public Boolean | getBoolean(Server server, String name) This is used to fetch the value of the property as a Boolean. | public Integer | getInteger(Server server, String name) This is used to fetch the value of the property as an Integer. | public String | getName() The name of the configuration property that this ConfigOption was constructed with. | public String | getProperty(Server server, String name) This is used to fetch the value of the property. | public String | toHelp() This method is used to return a user viewable help string in case an object was misconfigured. |
isRequired | boolean isRequired(Code) | | |
ConfigOption | public ConfigOption(String propertyName, String helpString)(Code) | | This is used to create an optional property that defaults to null if unspecified.
Parameters: propertyName - the name of the property. Parameters: helpString - the help string shown to the user. |
ConfigOption | public ConfigOption(String propertyName, String defaultValue, String helpString)(Code) | | This is used to create an optional property that has a supplied default value.
Parameters: propertyName - the name of the property. Parameters: defaultValue - the default value used if this property is unspecified. Parameters: helpString - the help string shown to the user. |
ConfigOption | public ConfigOption(String propertyName, boolean required, String helpString)(Code) | | This is used to create a required property. There is no default supplied in the case
where required is true. If you specify it as false it's the same as an optional property
with no default.
Parameters: propertyName - the name of the property. Parameters: required - Used to specify a required property. True for required, false for optional. Parameters: helpString - the help string shown to the user if nothing is specified. |
getBoolean | public Boolean getBoolean(Server server, String name)(Code) | | This is used to fetch the value of the property as a Boolean. It will return
the default property if it's not specified.
Parameters: server - the Server object used by the system. Parameters: name - the name of the handler or endpoint instance. a Boolean value of the property or the default value if it was supplied in the constructor. |
getInteger | public Integer getInteger(Server server, String name)(Code) | | This is used to fetch the value of the property as an Integer. It will return
the default property if it's not specified.
Parameters: server - the Server object used by the system. Parameters: name - the name of the handler or endpoint instance. an Integer value of the property or the default value if it was supplied in the constructor. |
getName | public String getName()(Code) | | The name of the configuration property that this ConfigOption was constructed with.
the propery's name. |
getProperty | public String getProperty(Server server, String name)(Code) | | This is used to fetch the value of the property. It's returned as a String. It will return
the default property if it's not specified.
Parameters: server - the Server object used by the system. Parameters: name - the name of the handler or endpoint instance. the value of the property or the default value if it was supplied in the constructor. |
toHelp | public String toHelp()(Code) | | This method is used to return a user viewable help string in case an object was misconfigured.
the user viewable string for misconfigured properties. |
|
|