Module com.github.rvesse.airline.io
Class AnsiColorSource<T extends AnsiColorProvider>
java.lang.Object
com.github.rvesse.airline.io.colors.sources.AnsiColorSource<T>
- All Implemented Interfaces:
ControlCodeSource<T>
- Direct Known Subclasses:
AnsiBackgroundColorSource
,AnsiForegroundColorSource
public abstract class AnsiColorSource<T extends AnsiColorProvider>
extends Object
implements ControlCodeSource<T>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetControlCode
(T attributeSource) Translates the attribute source into a control code that can be passed to an input/output streamGets a reset code that can be used to reset any changes previously made by any attributes of the type supported by this sourcegetResetControlCode
(T attributeSource) Gets a reset code that can be used to reset any changes previously made by the given attribute
-
Field Details
-
foreground
private final boolean foreground
-
-
Constructor Details
-
AnsiColorSource
public AnsiColorSource() -
AnsiColorSource
protected AnsiColorSource(boolean foreground)
-
-
Method Details
-
getControlCode
Description copied from interface:ControlCodeSource
Translates the attribute source into a control code that can be passed to an input/output stream- Specified by:
getControlCode
in interfaceControlCodeSource<T extends AnsiColorProvider>
- Parameters:
attributeSource
- Attribute source- Returns:
- Control code
-
getResetControlCode
Description copied from interface:ControlCodeSource
Gets a reset code that can be used to reset any changes previously made by the given attribute- Specified by:
getResetControlCode
in interfaceControlCodeSource<T extends AnsiColorProvider>
- Parameters:
attributeSource
- Attribute source- Returns:
- Control code
-
getFullResetControlCode
Description copied from interface:ControlCodeSource
Gets a reset code that can be used to reset any changes previously made by any attributes of the type supported by this source- Specified by:
getFullResetControlCode
in interfaceControlCodeSource<T extends AnsiColorProvider>
- Returns:
- Control Code
-