- java.lang.Object
-
- org.jline.style.MemoryStyleSource
-
- All Implemented Interfaces:
StyleSource
public class MemoryStyleSource extends Object implements StyleSource
In-memoryStyleSource.- Since:
- 3.4
-
-
Constructor Summary
Constructors Constructor Description MemoryStyleSource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Clear all styles.Stringget(String group, String name)Returns the appropriate style for the given style-group and style-name, ornullif missing.Iterable<String>groups()Returns configured style-group names.voidremove(String group)Remove all styles for given style-group.voidremove(String group, String name)Remove a specific style from style-group.voidset(String group, String name, String style)Set a specific style in a style-group.Map<String,String>styles(String group)Returns configured styles for given style-group.
-
-
-
Method Detail
-
get
@Nullable public String get(String group, String name)
Description copied from interface:StyleSourceReturns the appropriate style for the given style-group and style-name, ornullif missing.- Specified by:
getin interfaceStyleSource- Parameters:
group- the groupname- the style name- Returns:
- the style
-
set
public void set(String group, String name, String style)
Description copied from interface:StyleSourceSet a specific style in a style-group.- Specified by:
setin interfaceStyleSource- Parameters:
group- the groupname- the style namestyle- the style to set
-
remove
public void remove(String group)
Description copied from interface:StyleSourceRemove all styles for given style-group.- Specified by:
removein interfaceStyleSource- Parameters:
group- the group
-
remove
public void remove(String group, String name)
Description copied from interface:StyleSourceRemove a specific style from style-group.- Specified by:
removein interfaceStyleSource- Parameters:
group- the groupname- the style name to remove
-
clear
public void clear()
Description copied from interface:StyleSourceClear all styles.- Specified by:
clearin interfaceStyleSource
-
groups
public Iterable<String> groups()
Description copied from interface:StyleSourceReturns configured style-group names.- Specified by:
groupsin interfaceStyleSource- Returns:
- Immutable collection.
-
styles
public Map<String,String> styles(String group)
Description copied from interface:StyleSourceReturns configured styles for given style-group.- Specified by:
stylesin interfaceStyleSource- Parameters:
group- the style group- Returns:
- Immutable map.
-
-