Package org.refcodes.console
Class ConsoleSugar
- java.lang.Object
-
- org.refcodes.console.ConsoleSugar
-
public class ConsoleSugar extends java.lang.Object
-
-
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 Switch
forcesSwitch()
Forces switch.static Switch
forcesSwitch(java.lang.String aDescription)
Forces switch.static Switch
helpSwitch()
Help switch.static Switch
helpSwitch(java.lang.String aDescription)
Help switch.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 Switch
quietSwitch()
Quiet switch.static Switch
quietSwitch(java.lang.String aDescription)
Quiet switch.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 Switch
switsh(java.lang.String aShortOption, java.lang.String aLongOption, java.lang.String aDescription)
As "switch" is a reserved word in Java, we use "switsh" :-(.static Switch
sysInfoSwitch()
Sys info switch.static Switch
sysInfoSwitch(java.lang.String aDescription)
Sys info switch.static Switch
verboseSwitch()
Verbose switch.static Switch
verboseSwitch(java.lang.String aDescription)
Verbose switch.static Condition
xor(Syntaxable... aArgs)
Xor.
-
-
-
Method Detail
-
and
public static Condition and(Syntaxable... aArgs)
And.- Parameters:
aArgs
- the args- Returns:
- the condition
- See Also:
AndConditionImpl
-
or
public static Condition or(Syntaxable... aArgs)
Or.- Parameters:
aArgs
- the args- Returns:
- the condition
- See Also:
OrConditionImpl
-
xor
public static Condition xor(Syntaxable... aArgs)
Xor.- Parameters:
aArgs
- the args- Returns:
- the condition
- See Also:
XorConditionImpl
-
optional
public static Condition optional(Syntaxable... aArg)
Optional.- Parameters:
aArg
- the arg- Returns:
- the condition
- See Also:
OptionalConditionImpl
-
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 optionaLongOption
- the long optionaType
- the typeaAlias
- the option arg nameaDescription
- the description- Returns:
- the option
- See Also:
EnumOptionImpl
-
switsh
public static Switch switsh(java.lang.String aShortOption, java.lang.String aLongOption, java.lang.String aDescription)
As "switch" is a reserved word in Java, we use "switsh" :-(.- Parameters:
aShortOption
- the short optionaLongOption
- the long optionaDescription
- the description- Returns:
- the switch
- See Also:
Switch
-
forcesSwitch
public static Switch forcesSwitch(java.lang.String aDescription)
Forces switch.- Parameters:
aDescription
- the description- Returns:
- the switch
- See Also:
ForceSwitchImpl
-
forcesSwitch
public static Switch forcesSwitch()
Forces switch.- Returns:
- the switch
- See Also:
ForceSwitchImpl
-
helpSwitch
public static Switch helpSwitch(java.lang.String aDescription)
Help switch.- Parameters:
aDescription
- the description- Returns:
- the switch
- See Also:
HelpSwitchImpl
-
helpSwitch
public static Switch helpSwitch()
Help switch.- Returns:
- the switch
- See Also:
HelpSwitchImpl
-
sysInfoSwitch
public static Switch sysInfoSwitch(java.lang.String aDescription)
Sys info switch.- Parameters:
aDescription
- the description- Returns:
- the switch
- See Also:
SysInfoSwitchImpl
-
sysInfoSwitch
public static Switch sysInfoSwitch()
Sys info switch.- Returns:
- the switch
- See Also:
SysInfoSwitchImpl
-
quietSwitch
public static Switch quietSwitch(java.lang.String aDescription)
Quiet switch.- Parameters:
aDescription
- the description- Returns:
- the switch
- See Also:
QuietSwitchImpl
-
quietSwitch
public static Switch quietSwitch()
Quiet switch.- Returns:
- the switch
- See Also:
QuietSwitchImpl
-
verboseSwitch
public static Switch verboseSwitch(java.lang.String aDescription)
Verbose switch.- Parameters:
aDescription
- the description- Returns:
- the switch
- See Also:
VerboseSwitchImpl
-
verboseSwitch
public static Switch verboseSwitch()
Verbose switch.- Returns:
- the switch
- See Also:
VerboseSwitchImpl
-
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 optionaLongOption
- the long optionaAlias
- the option arg nameaDescription
- 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 optionaLongOption
- the long optionaAlias
- the option arg nameaDescription
- 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 identifieraDescription
- the description- Returns:
- the operand
- See Also:
StringOperandImpl
-
-