Package org.jline.style
Class MemoryStyleSource
- java.lang.Object
-
- org.jline.style.MemoryStyleSource
-
- All Implemented Interfaces:
StyleSource
public class MemoryStyleSource extends java.lang.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.java.lang.Stringget(java.lang.String group, java.lang.String name)Returns the appropriate style for the given style-group and style-name, ornullif missing.java.lang.Iterable<java.lang.String>groups()Returns configured style-group names.voidremove(java.lang.String group)Remove all styles for given style-group.voidremove(java.lang.String group, java.lang.String name)Remove a specific style from style-group.voidset(java.lang.String group, java.lang.String name, java.lang.String style)Set a specific style in a style-group.java.util.Map<java.lang.String,java.lang.String>styles(java.lang.String group)Returns configured styles for given style-group.
-
-
-
Method Detail
-
get
@Nullable public java.lang.String get(java.lang.String group, java.lang.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(java.lang.String group, java.lang.String name, java.lang.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(java.lang.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(java.lang.String group, java.lang.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 java.lang.Iterable<java.lang.String> groups()
Description copied from interface:StyleSourceReturns configured style-group names.- Specified by:
groupsin interfaceStyleSource- Returns:
- Immutable collection.
-
styles
public java.util.Map<java.lang.String,java.lang.String> styles(java.lang.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.
-
-