Class ConsoleSugar



  • public class ConsoleSugar
    extends Object
    Declarative syntactic sugar which may be statically imported in order to allow declarative definitions for the command line Flag, Condition, Option and Operand elements.
    • Constructor Detail

      • ConsoleSugar

        public ConsoleSugar​()
    • Method Detail

      • enumOption

        public static <T extends Enum<T>> EnumOption<T> enumOption​(String aShortOption,
                                                                   String aLongOption,
                                                                   Class<T> aType,
                                                                   String aAlias,
                                                                   String aDescription)
        Enum option.
        Type Parameters:
        T - the generic type
        Parameters:
        aShortOption - the short option
        aLongOption - the long option
        aType - the type
        aAlias - the option arg name
        aDescription - the description
        Returns:
        the option
        See Also:
        EnumOption
      • enumOption

        public static <T extends Enum<T>> EnumOption<T> enumOption​(String aLongOption,
                                                                   Class<T> aType,
                                                                   String aAlias,
                                                                   String aDescription)
        Enum option.
        Type Parameters:
        T - the generic type
        Parameters:
        aLongOption - the long option
        aType - the type
        aAlias - the option arg name
        aDescription - the description
        Returns:
        the option
        See Also:
        EnumOption
      • flag

        public static Flag flag​(String aLongOption,
                                String aAlias,
                                String aDescription)
        As "flag" is a reserved word in Java, we use "flag" :-(.
        Parameters:
        aLongOption - the long option
        aAlias - The alias of the flag
        aDescription - the description
        Returns:
        the flag
        See Also:
        Flag
      • flag

        public static Flag flag​(String aShortOption,
                                String aLongOption,
                                String aAlias,
                                String aDescription)
        As "flag" is a reserved word in Java, we use "flag" :-(.
        Parameters:
        aShortOption - the short option
        aLongOption - the long option
        aAlias - The alias of the flag
        aDescription - the description
        Returns:
        the flag
        See Also:
        Flag
      • forcesFlag

        public static Flag forcesFlag​(String aDescription)
        Forces flag.
        Parameters:
        aDescription - the description
        Returns:
        the flag
        See Also:
        ForceFlag
      • forcesFlag

        public static Flag forcesFlag​()
        Forces flag.
        Returns:
        the flag
        See Also:
        ForceFlag
      • helpFlag

        public static Flag helpFlag​(String aDescription)
        Help flag.
        Parameters:
        aDescription - the description
        Returns:
        the flag
        See Also:
        HelpFlag
      • helpFlag

        public static Flag helpFlag​()
        Help flag.
        Returns:
        the flag
        See Also:
        HelpFlag
      • sysInfoFlag

        public static Flag sysInfoFlag​(String aDescription)
        Sys info flag.
        Parameters:
        aDescription - the description
        Returns:
        the flag
        See Also:
        SysInfoFlag
      • sysInfoFlag

        public static Flag sysInfoFlag​()
        Sys info flag.
        Returns:
        the flag
        See Also:
        SysInfoFlag
      • quietFlag

        public static Flag quietFlag​(String aDescription)
        Quiet flag.
        Parameters:
        aDescription - the description
        Returns:
        the flag
        See Also:
        QuietFlag
      • quietFlag

        public static Flag quietFlag​()
        Quiet flag.
        Returns:
        the flag
        See Also:
        QuietFlag
      • verboseFlag

        public static Flag verboseFlag​(String aDescription)
        Verbose flag.
        Parameters:
        aDescription - the description
        Returns:
        the flag
        See Also:
        VerboseFlag
      • verboseFlag

        public static Flag verboseFlag​()
        Verbose flag.
        Returns:
        the flag
        See Also:
        VerboseFlag
      • verboseDebug

        public static Flag verboseDebug​(String aDescription)
        Debug flag.
        Parameters:
        aDescription - the description
        Returns:
        the flag
        See Also:
        DebugFlag
      • debugFlag

        public static Flag debugFlag​()
        Debug flag.
        Returns:
        the flag
        See Also:
        VerboseFlag
      • intOption

        public static IntegerOption intOption​(String aLongOption,
                                              String aAlias,
                                              String aDescription)
        Int option.
        Parameters:
        aLongOption - the long option
        aAlias - the option arg name
        aDescription - the description
        Returns:
        the option
        See Also:
        IntegerOption
      • intOption

        public static IntegerOption intOption​(String aShortOption,
                                              String aLongOption,
                                              String aAlias,
                                              String aDescription)
        Int option.
        Parameters:
        aShortOption - the short option
        aLongOption - the long option
        aAlias - the option arg name
        aDescription - the description
        Returns:
        the option
        See Also:
        IntegerOption
      • longOption

        public static LongOption longOption​(String aLongOption,
                                            String aAlias,
                                            String aDescription)
        Long option.
        Parameters:
        aLongOption - the long option
        aAlias - the option arg name
        aDescription - the description
        Returns:
        the option
        See Also:
        LongOption
      • longOption

        public static LongOption longOption​(String aShortOption,
                                            String aLongOption,
                                            String aAlias,
                                            String aDescription)
        Long option.
        Parameters:
        aShortOption - the short option
        aLongOption - the long option
        aAlias - the option arg name
        aDescription - the description
        Returns:
        the option
        See Also:
        LongOption
      • floatOption

        public static FloatOption floatOption​(String aLongOption,
                                              String aAlias,
                                              String aDescription)
        Float option.
        Parameters:
        aLongOption - the long option
        aAlias - the option arg name
        aDescription - the description
        Returns:
        the option
        See Also:
        LongOption
      • floatOption

        public static FloatOption floatOption​(String aShortOption,
                                              String aLongOption,
                                              String aAlias,
                                              String aDescription)
        Float option.
        Parameters:
        aShortOption - the short option
        aLongOption - the long option
        aAlias - the option arg name
        aDescription - the description
        Returns:
        the option
        See Also:
        LongOption
      • doubleOption

        public static DoubleOption doubleOption​(String aLongOption,
                                                String aAlias,
                                                String aDescription)
        Double option.
        Parameters:
        aLongOption - the long option
        aAlias - the option arg name
        aDescription - the description
        Returns:
        the option
        See Also:
        LongOption
      • doubleOption

        public static DoubleOption doubleOption​(String aShortOption,
                                                String aLongOption,
                                                String aAlias,
                                                String aDescription)
        Double option.
        Parameters:
        aShortOption - the short option
        aLongOption - the long option
        aAlias - the option arg name
        aDescription - the description
        Returns:
        the option
        See Also:
        LongOption
      • stringOption

        public static StringOption stringOption​(String aLongOption,
                                                String aAlias,
                                                String aDescription)
        String option.
        Parameters:
        aLongOption - the long option
        aAlias - the option arg name
        aDescription - the description
        Returns:
        the option
        See Also:
        StringOption
      • stringOption

        public static StringOption stringOption​(String aShortOption,
                                                String aLongOption,
                                                String aAlias,
                                                String aDescription)
        String option.
        Parameters:
        aShortOption - the short option
        aLongOption - the long option
        aAlias - the option arg name
        aDescription - the description
        Returns:
        the option
        See Also:
        StringOption
      • fileOption

        public static FileOption fileOption​(String aLongOption,
                                            String aAlias,
                                            String aDescription)
        Creates a FileOption for getting a File instance from a path.
        Parameters:
        aLongOption - the long option
        aAlias - the option arg name
        aDescription - the description
        Returns:
        the option
        See Also:
        FileOption
      • fileOption

        public static FileOption fileOption​(String aShortOption,
                                            String aLongOption,
                                            String aAlias,
                                            String aDescription)
        String option.
        Parameters:
        aShortOption - the short option
        aLongOption - the long option
        aAlias - the option arg name
        aDescription - the description
        Returns:
        the option
        See Also:
        FileOption
      • stringOperand

        public static StringOperand stringOperand​(String aIdentifier,
                                                  String aDescription)
        String operand.
        Parameters:
        aIdentifier - the identifier
        aDescription - the description
        Returns:
        the operand
        See Also:
        StringOperand