Class ConsoleSugar


  • public class ConsoleSugar
    extends java.lang.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 Summary

      Constructors 
      Constructor Description
      ConsoleSugar()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static Condition and​(Syntaxable... aArgs)
      And.
      static <T extends java.lang.Enum<T>>
      Option<T>
      enumOption​(java.lang.String aShortOption, java.lang.String aLongOption, java.lang.Class<T> aType, java.lang.String aAlias, java.lang.String aDescription)
      Enum option.
      static Flag flag​(java.lang.String aShortOption, java.lang.String aLongOption, java.lang.String aDescription)
      As "flag" is a reserved word in Java, we use "flag" :-(.
      static Flag flag​(java.lang.String aShortOption, java.lang.String aLongOption, java.lang.String aAlias, java.lang.String aDescription)
      As "flag" is a reserved word in Java, we use "flag" :-(.
      static Flag forcesFlag()
      Forces flag.
      static Flag forcesFlag​(java.lang.String aDescription)
      Forces flag.
      static Flag helpFlag​(java.lang.String aDescription)
      Help flag.
      static Flag helpSwitch()
      Help flag.
      static Option<java.lang.Integer> intOption​(java.lang.String aShortOption, java.lang.String aLongOption, java.lang.String aAlias, java.lang.String aDescription)
      Int option.
      static Condition optional​(Syntaxable... aArg)
      Optional.
      static Condition or​(Syntaxable... aArgs)
      Or.
      static Flag quietFlag​(java.lang.String aDescription)
      Quiet flag.
      static Flag quietSwitch()
      Quiet flag.
      static Operand<java.lang.String> stringOperand​(java.lang.String aIdentifier, java.lang.String aDescription)
      String operand.
      static Option<java.lang.String> stringOption​(java.lang.String aShortOption, java.lang.String aLongOption, java.lang.String aAlias, java.lang.String aDescription)
      String option.
      static Flag sysInfoFlag()
      Sys info flag.
      static Flag sysInfoFlag​(java.lang.String aDescription)
      Sys info flag.
      static Flag verboseSwitch()
      Verbose flag.
      static Flag verboseSwitch​(java.lang.String aDescription)
      Verbose flag.
      static Condition xor​(Syntaxable... aArgs)
      Xor.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ConsoleSugar

        public ConsoleSugar()
    • Method Detail

      • enumOption

        public static <T extends java.lang.Enum<T>> Option<T> enumOption​(java.lang.String aShortOption,
                                                                         java.lang.String aLongOption,
                                                                         java.lang.Class<T> aType,
                                                                         java.lang.String aAlias,
                                                                         java.lang.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:
        EnumOptionImpl
      • flag

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

        public static Flag flag​(java.lang.String aShortOption,
                                java.lang.String aLongOption,
                                java.lang.String aAlias,
                                java.lang.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​(java.lang.String aDescription)
        Forces flag.
        Parameters:
        aDescription - the description
        Returns:
        the flag
        See Also:
        ForceFlagImpl
      • forcesFlag

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

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

        public static Flag helpSwitch()
        Help flag.
        Returns:
        the flag
        See Also:
        HelpFlagImpl
      • sysInfoFlag

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

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

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

        public static Flag quietSwitch()
        Quiet flag.
        Returns:
        the flag
        See Also:
        QuietFlagImpl
      • verboseSwitch

        public static Flag verboseSwitch​(java.lang.String aDescription)
        Verbose flag.
        Parameters:
        aDescription - the description
        Returns:
        the flag
        See Also:
        VerboseFlagImpl
      • verboseSwitch

        public static Flag verboseSwitch()
        Verbose flag.
        Returns:
        the flag
        See Also:
        VerboseFlagImpl
      • intOption

        public static Option<java.lang.Integer> intOption​(java.lang.String aShortOption,
                                                          java.lang.String aLongOption,
                                                          java.lang.String aAlias,
                                                          java.lang.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:
        IntegerOptionImpl
      • stringOption

        public static Option<java.lang.String> stringOption​(java.lang.String aShortOption,
                                                            java.lang.String aLongOption,
                                                            java.lang.String aAlias,
                                                            java.lang.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:
        StringOptionImpl
      • stringOperand

        public static Operand<java.lang.String> stringOperand​(java.lang.String aIdentifier,
                                                              java.lang.String aDescription)
        String operand.
        Parameters:
        aIdentifier - the identifier
        aDescription - the description
        Returns:
        the operand
        See Also:
        StringOperandImpl