Class Property


  • public class Property
    extends BaseOption
    A property is an option where the value is a key-value pair, and applies the key value onto a putter.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static interface  Property.Putter
      Basic interface for putting value onto a map, properties or config.
    • Constructor Summary

      Constructors 
      Constructor Description
      Property​(char shortName, java.lang.String metaKey, java.lang.String metaVar, java.lang.String usage, Property.Putter properties)
      Create a property argument.
      Property​(char shortName, java.lang.String metaKey, java.lang.String metaVar, java.lang.String usage, Property.Putter properties, boolean hidden)
      Create a property argument.
      Property​(char shortName, java.lang.String usage, Property.Putter properties)
      Create a property argument with default key and value names.
      Property​(java.lang.String name, char shortName, java.lang.String metaKey, java.lang.String metaVar, java.lang.String usage, Property.Putter properties, boolean hidden)
      Create a property argument.
      Property​(java.lang.String name, char shortName, java.lang.String usage, Property.Putter properties)
      Create a property argument with default key and value names.
    • Constructor Detail

      • Property

        public Property​(char shortName,
                        java.lang.String usage,
                        Property.Putter properties)
        Create a property argument with default key and value names.
        Parameters:
        shortName - The short name character.
        usage - The usage string.
        properties - The properties instance to populate.
      • Property

        public Property​(java.lang.String name,
                        char shortName,
                        java.lang.String usage,
                        Property.Putter properties)
        Create a property argument with default key and value names.
        Parameters:
        name - The long option name.
        shortName - The short name character.
        usage - The usage string.
        properties - The properties instance to populate.
      • Property

        public Property​(char shortName,
                        java.lang.String metaKey,
                        java.lang.String metaVar,
                        java.lang.String usage,
                        Property.Putter properties)
        Create a property argument.
        Parameters:
        shortName - The short name character.
        metaKey - The meta key name.
        metaVar - The meta value name.
        usage - The usage string.
        properties - The properties instance to populate.
      • Property

        public Property​(char shortName,
                        java.lang.String metaKey,
                        java.lang.String metaVar,
                        java.lang.String usage,
                        Property.Putter properties,
                        boolean hidden)
        Create a property argument.
        Parameters:
        shortName - The short name character.
        metaKey - The meta key name.
        metaVar - The meta value name.
        usage - The usage string.
        properties - The properties instance to populate.
        hidden - If the property argument should be hidden.
      • Property

        public Property​(java.lang.String name,
                        char shortName,
                        java.lang.String metaKey,
                        java.lang.String metaVar,
                        java.lang.String usage,
                        Property.Putter properties,
                        boolean hidden)
        Create a property argument.
        Parameters:
        name - The long option name.
        shortName - The short name character.
        metaKey - The meta key name.
        metaVar - The meta value name.
        usage - The usage string.
        properties - The properties instance to populate.
        hidden - If the property argument should be hidden.
    • Method Detail

      • getMetaKey

        public java.lang.String getMetaKey()
        Returns:
        The meta key name.
      • getSingleLineUsage

        public java.lang.String getSingleLineUsage()
        Description copied from class: BaseArgument
        Get the argument's single line usage string.
        Overrides:
        getSingleLineUsage in class BaseOption
        Returns:
        The single-line usage string.
      • getPrefix

        public java.lang.String getPrefix()
        Description copied from class: BaseArgument
        Prefix part of the usage usage message.
        Overrides:
        getPrefix in class BaseOption
        Returns:
        The usage prefix.
      • applyShort

        public int applyShort​(java.lang.String opts,
                              ArgumentList args)
        Description copied from class: BaseOption
        When handling a list of short options, except for the last short option.
        Specified by:
        applyShort in class BaseOption
        Parameters:
        opts - The remaining characters of the short opt list.
        args - The list of arguments including the short opt list.
        Returns:
        The number of arguments consumed. If 0 is returned, will handle as the short option char was the only thing being consumed.
      • apply

        public int apply​(ArgumentList args)
        Description copied from class: BaseOption
        Parse the argument list, including the argument string that triggered the call. And handle it's value or values.
        Specified by:
        apply in class BaseOption
        Parameters:
        args - The list of arguments.
        Returns:
        The number of arguments consumed.